Because Leia saved an ewok who found her (Wicket) from the imperial scout (and was friendly to him just prior to that).
From the script:
LEIA: Look, it's a hat. It's not gonna hurt you. Look. You're a jittery
little thing, aren't you?
Reassured, Wicket lowers his spear and climbs back on the log, coming
to investigate the helmet. Suddenly his ears perk up and he begins to
sniff the air. He looks around warily, whispering some Ewokese warning
to Leia.
LEIA What is it?
Suddenly a laser bolt comes out of the foliage and explodes on the log
next to Leia. Leia and Wicket both roll backwards off the log, hiding
behind it. Leia holds her own laser gun ready, while Wicket disappears
underneath the log. Another shot, and still no sight of anyone in the
forest. Then Leia senses something and turns to find a large IMPERIAL
SCOUT standing over her with his weapon pointed at her head. He
reaches out his hand for her weapon.
SCOUT #l Freeze! Come on, get up!
She hands the weapon over, as a second scout emerges from the foliage
in front of the log.
SCOUT #1 Go get your ride and take her back to base.
SCOUT #2 Yes, sir.
The second scout starts toward his bike, as Wicket, crouched under the
log, extends his spear and hits the first scout on the leg. The scout
jumps and lets out an exclamation, and looks down at Wicket, puzzled.
Leia grabs a branch and knocks him out. She dives for his laser
pistol, and the second scout, now on his bike, takes off. Leia fires
away and hits the escaping bike, causing it to crash into the first
scout's bike, which flies end over end and explodes. The forest is
quiet once more. Wicket pokes his fuzzy head up from behind the log
and regards Leia with new respect. He mumbles his awe. Leia hurries
over, looking around all the time, and motions the chubby little
creature into the dense foliage.
From the James Kahn novelization, based on screenplay:
Suddenly Wicket froze; his ears twitched, and he sniffed the air. He
tilted his head in an attitude of keen attention.
'What is it?' Leia whispered. Something was obviously amiss. Then she
heard it: a quiet snap in the bushes beyond, a tentative rustling.
All at once the Ewok let out a loud, terrified screech. Leia drew her
pistol, jumping behind the log; Wicket scurried beside her and
squeezed under it. A long silence followed. Tense, uncertain, Leia
trained her senses on the near underbrush. Ready to fight.
For all her readiness, she hadn't expected the laser bolt to come from
where it did - high, off to the right. It exploded in front of the log
with a shower of light and pine needles. She returned the fire quickly
- two short blasts - then just as quickly sensed something behind her. Slowly she swiveled, to find an Imperial scout standing over her, his
weapon leveled at her head. He reached out his hand for the pistol she
held.
'I'll take that,' he ordered.
Without warning, a furry hand came out from under the log and jabbed
the scout in the leg with a knife. The man howled in pain, began
jumping about on one foot.
Leia dove for his fallen laser pistol. She rolled, fired and hit the
scout squarely in the chest, flash-burning his heart.
Wicket poked his fuzzy head up from under the log, and looked around.
'Eeep rrp scrp ooooh,' he mumbled in a tone of awe.
Clearly, any enemy of Stormtroopers was not Ewok's enemy, but a powerful ally.
As far as Luke, Han and company: