Harry considers the veela dangerous, so he resists them
Harry, when first encountering the veela during the 1994 Quidditch World Cup, (where veelas acted as cheerleader squad for the Bulgarian team) was taken by surprise, same as Ron. At first, Harry was completey enchanted, and found the veela beautiful:
"Veela were women… the most beautiful women Harry had ever seen…"
~Harry Potter and the Goblet of Fire - Chapter 8: The Quidditch World Cup
And he was completely overtaken by their magic:
"... Harry stopped worrying about them not being human—in fact, he
stopped worrying about anything at all. The veela had started to
dance, and Harry’s mind had gone completely and blissfully blank. All
that mattered in the world was that he kept watching the veela,
because if they stopped dancing, terrible things would happen."
"And as the veela danced faster and faster, wild, half formed thoughts
started chasing through Harry’s dazed mind. He wanted to do something
very impressive, right now. Jumping from the box into the stadium
seemed a good idea… but would it be good enough?"
Harry and Ron had the exact same response: They decided to
support the Bulgarian quidditch team and tried to dive from the podium to impress the veela.
Later in the game, however, Harry witnesses the veela using their magic to influence the referee:
"Harry looked down at the field. Hassan Mostafa had landed right in
front of the dancing veela, and was acting very oddly indeed. He was
flexing his muscles and smoothing his mustache excitedly. “Now, we
can’t have that!” said Ludo Bagman, though he sounded highly amused.
“Somebody slap the referee!” A mediwizard came tearing across the
field, his fingers stuffed into his own ears, and kicked Mostafa hard
in the shins."
Seeing them without glamour seemed to sober Harry up completely:
"...the veela lost control. Instead of dancing, they launched
themselves across the field and began throwing what seemed to be
handfuls of fire at the leprechauns. Watching through his Omnioculars,
Harry saw that they didn’t look remotely beautiful now. On the contrary, their faces were elongating into sharp, cruel beaked bird
heads, and long, scaly wings were bursting from their shoulders— “And
that, boys,” yelled Mr. Weasley over the tumult of the crowd below,
“is why you should never go for looks alone!”
After witnessing all this Harry probably classified the veela as dangerous magical beings, not unlike those he learned about the previous year in his DADA lessons from professor Lupin.
Ron, on the other hand, seems to posess a much simpler approach towards the veela: veelas are beautiful, so he is entranced by them. It is never shown that he is wary of the veela when he is our if their 'range', and when they approach him he seems immediately fall under their influence each time.
It is not as if Harry isn't suspectible to the charms of the veela, he clearly is, but he chose to resist them, and he does it successfully. Harry has a remarkably strong will against mind control, (later in the same year he was even successful resisting the imperius curse), so it is unsurprising that he was also successful to resist the veela as soon as he understood why it would be embarrassing or even dangerous to succumb to the veela charms.
It is not described how exactly he does it: in the case of Fleur Delacour (who is part veela) Harry has clearly no problem maintaining eye contact and communicating with her without being affected:
At that moment, a voice said, “Excuse me, are you wanting ze
bouillabaisse?” It was the girl from Beauxbatons who had laughed
during Dumbledore’s speech. She had finally removed her muffler. A
long sheet of silvery blonde hair fell almost to her waist. She had
large, deep blue eyes, and very white, even teeth. Ron went purple. He
stared up at her, opened his mouth to reply, but nothing came out
except a faint gurgling noise. “Yeah, have it,” said Harry, pushing
the dish toward the girl. “You ’ave finished wiz it?” “Yeah,” Ron said
breathlessly. “Yeah, it was excellent.” ~Harry Potter and the Goblet of Fire - Chapter 16: The Goblet of Fire '
Notice how different is the boys reaction, through both are looking at Fleur, Ron is completely smitten by her, while Harry seems uninterested.
It seems that having a romantic interest or being in a relationship gives immunity from the veela charms
In addition, Harry was interested in Cho Chang, so it's likely that it's also boosted his 'will save'. It seems that when a person already has a romantic interest, veela magic has much less effect: Cedric Diggory, for example, who was also interested in Cho, remained unaffected by Fleur, unlike Ron, who passed by at that time and became the unintended victim of her charm, asking her out and thus embarrassing himself.
Yet, unlike Harry, even after encountering veela a few times and 'getting burned' each time, Ron is unable to draw conclusions based on these encounters - he just thinks veela are beautiful, Fleur is beautiful, so she must be one, and has no idea what happened to him:
“I don’t know what made me do it!” Ron gasped again. “What was I
playing at? There were people—all around—I’ve gone mad—everyone
watching! I was just walking past her in the entrance hall—she was
standing there talking to Diggory—and it sort of came over me—and I
Harry is the one who has to explain to him how veela charms work and what happened to him:
“She’s part veela,” said Harry. “You were right—her grandmother was
one. It wasn’t your fault, I bet you just walked past when she was
turning on the old charm for Diggory and got a blast of it—but she was
wasting her time. He’s going with Cho Chang.”
I don't blame those fans who after reading the books or watching the films are of the opinion that Ron is a bit simple minded (despite being introduced in the first book as a wizard-chess grandmaster.) Ron, unlike Harry, doesn't seem to posess the ability to analyze data and draw conclusions, doesn't have a strong will like Harry, and growing up in a protected and supportive environment, he is less wary of the intentions of strangers. In addition, unlike Harry who had shown interest in Cho from the beginning of the fourth year, Ron at the same time seems less aware of the girls around him:
“Hermione, Neville’s right—you are a girl…”
~ Harry Potter and the Goblet of Fire - Chapter 22: The Unexpected Task
therefore it is understandable that in their fourth year Ron was easily distracted by and was much more susceptible to veela charms as it probably hadn't even occured to him to resist them. Even in his sixth year he seems to be a bit infatuated with Fleur during her visit to the Burrow and he is teased about it mercilessly by Ginny.
“Oh, that’s right, defend her,” snapped Ginny. “We all know you can’t
get enough of her.”
Harry Potter and the Half Blood prince - Chapter 5: An Excess of Phlegm
As Ginny notes later in the Trio's sixth year, Ron, as opposed to Harry at that point lacked experience with girls:
“No, I will not!” yelled Ginny, beside herself. “I’ve seen you with
Phlegm, hoping she’ll kiss you on the cheek every time you see her,
it’s pathetic! If you went out and got a bit of snogging done
yourself, you wouldn’t mind so much that everyone else does it!”
~Harry Potter and the Half Blood Prince - Chapter 14 : Felix
So Ginny more or less describes Ron as a randy teenager who lacks experience with girls, so he is weak against veela charms. Possibly that later, when Ron realized his feelings for Hermione and started going out with her he was able to fight veela influence better.