If they wanted to name them after a Greek god, why not Artemis? Artemis was the god of the moon, and Apollo was the god of the sun. Is there something I was missing?
Artemis is the goddess of the moon, actually. But whether her gender played a factor in the choice of Apollo over Artemis is unknown to all but Abe Silverstein, the new Director of Space Flight, who named the project in 1960. According to Silverstein, he was captivated by the story in a book of Greek myths that he owned of Apollo carrying the sun across the sky in his golden chariot. The parallel to a spacecraft was clear and poetic to him.
Of note: the sun chariot is more frequently associated with Helios, the Titan who personifies the sun, than with Apollo. The two get conflated in some traditions--including the ones that Silverstein's mythology book must have referenced.