The explanation will vary a bit depending on which ancient source you read, because each source represents an interpretation of the mythical tradition. To an extent the same goes for modern interpretations.
In the Iliad no explicit explanation is given. The best you're going to get there is that it's a common trope that gods' interests align with cities where they have a significant cult, e.g. Hera with Argos, Athena with Athens. Apollo supposedly had a cult at Thymbra, a town about 10 km from Troy, and that would be the most obvious explanation there. An additional overdetermining of that explanation would be another cult to Apollo at Chryse, on Lemnos: that city had supposedly been sacked by the Greeks shortly before the opening of the Iliad, and the taking of Chryseis as Agamemnon's concubine was the initial provocation for the plot of the poem.
The other main explanation that you'll see in ancient sources is allegorical. A 6th century BCE exegesis by Theagenes of Rhegion interpreted his support for the Trojans a result of his affinity for archery, kithara-playing, and beauty, all of which (he claimed) was true of the Trojans too, especially Paris; and noted that he was associated with fire, and therefore opposed to Poseidon (water).
In modern interpretation the only variation on the above that you're likely to see is the suggestion that Apollo's eastern connections may tend to align him with the Anatolians: his nearest mythological cognate is a Cypriot-Ugaritic-Canaanite god called Reshep or Reshef, an archer god whose arrows sent plague; he's also closely associated with Lycia. Even people who cite these supposed connections, though (like I've just done), wouldn't want to push that very far, though. They're really just resemblances that happen to be suggestive, not a concrete explanation. After all, Apollo's cult at centres like Delphi and Delos show that he was thoroughly Hellenic; and Archaic-Classical Greek thought also associated him with Hyperborea (Ukraine). So there's nothing specifically Anatolian about him.
His alignment had no more effect on later interpretation than in the case of other gods who supported the Trojans (mainly Ares, Artemis, and Aphrodite). In the historical period the most important cult at Troy was to Athena, who in the Iliad is opposed to the Trojans. Thymbra ceased to exist probably in the 5th century BCE or shortly after. So there's no real predictive power in any of the arguments above: they're just the closest thing to a genuine explanation that the sources happen to offer.
Edit: minor grammatical stuff and a few minor additions.
In book one of the Iliad the Greeks were conducting raids on the towns near Troy. They took a lot of slaves and one of these slaves was Chryseis who was the daughter of a priest of Apollo named Chryses. Chryseis was given by the Greeks to Agamemnon who decided to keep her in spite of Chryses showing up and offering a fair bounty for her. He also mentions explicitly to Agamemnon that he has Apollo on his side. Chryses then prays to Apollo to strike down the Greeks with a plague.
Homer used a pretty heavy hand when it came to artistic license. Every group of people mentioned in the Iliad all speak the same language and worship the same gods. So it would not be seen as a Greek god betraying the Greeks. It is just a god meddling in the affairs of humans which was pretty much expected behavior.
My source is the translation by E.V. Rieu