Why is Heracles named after Hera if she hated him so much? He was Zeus's favored son but not Hera's.
This is from Eric Flaum's The Encyclopedia of Mythology.
Diodorus Siculus tells us that Heracles was originally named Alcaeus and was renamed Heracles1 after he gained glory with Hera's aid:
μετὰ δὲ ταῦτα ἡ μὲν Ἥρα δύο δράκοντας ἀπέστειλε τοὺς ἀναλώσοντας τὸ βρέφος, ὁ δὲ παῖς οὐ καταπλαγεὶς ἑκατέρᾳ τῶν χειρῶν τὸν αὐχένα σφίγξας ἀπέπνιξε τοὺς δράκοντας. διόπερ Ἀργεῖοι πυθόμενοι τὸ γεγονὸς Ἡρακλέα προσηγόρευσαν, ὅτι δἰ Ἥραν ἔσχε κλέος, Ἀλκαῖον πρότερον καλούμενον. τοῖς μὲν οὖν ἄλλοις οἱ γονεῖς τοὔνομα περιτιθέασι, τούτῳ δὲ μόνῳ ἡ ἀρετὴ τὴν προσηγορίαν ἔθετο.
Apollodorus also tells us that Hercules had a different name at birth (Alcides, which means grandson of Alcaeus), but gives a different account of his renaming:
Now it came to pass that after the battle with the Minyans Hercules was driven mad through the jealousy of Hera and flung his own children, whom he had by Megara, and two children of Iphicles into the fire; wherefore he condemned himself to exile, and was purified by Thespius, and repairing to Delphi he inquired of the god where he should dwell. The Pythian priestess then first called him Hercules, for hitherto he was called Alcides. And she told him to dwell in Tiryns, serving Eurystheus for twelve years and to perform the ten labours imposed on him, and so, she said, when the tasks were accomplished, he would be immortal.
I'm pretty sure there's another version of the story, where Heracles gets his name from Apollo, but I cannot remember the source.
1 Literally "Hera's glory"
The reason that his mother 'Alcmene' named him as such, was to mock Hera's failed attempts at preventing her from delivering her child into the world. She required assistance to escape the Hera's minions and her daughter Eileithyia, played a role in this. There are different accounts of the efforts Hera put into this plot. Hercule's birth was Hera's 'failure', so by calling it a 'glory' would ridicule.
Herakles ( ΗΡΑΚΛΗΣ ) as a word derives from ( ΗΡΑ ) which means Hera and ( ΚΛΕΟΣ ) which means glory. The word ΚΛΕΟΣ is used in many names. For instance: ( ΚΛΕΟΠΑΤΡΑ ) Cleopatra, ΚΛΕΟΣ + ΠΑΤΡΙΣ means Glory of the Country, what a name for the Egyptian queen! The respective male name is ( ΠΑΤΡΟΚΛΟΣ ) ΠΑΤΡΙΣ + ΚΛΕΟΣ and it means the same thing.
So ΚΛΕΟΣ means glory and ΗΡΑΚΛΗΣ ΗΡΑ + ΚΛΕΟΣ = HERA + GLORY, HERAKLES means the Glory of Hera.
The name might have been a mocking to Hera according to some sources, but I don't think so. This seems like a misunderstanding of Roman authors.
What I believe, according to Greek Ancient Religion and Mythology, is that the name was given in order to soothe Hera's wrath, not to challenge her. Hera's wrath was not something a mortal would like to cause and Alkmene ( ΑΛΚΜΗΝΗ ) had suffered enough. Alkmene was innocent, she thought she made love with her husband, so Hera focused her wrath on the kid, but still Alkmene was a mother, so she did her best to show respect to Hera, trying to save her son from her wrath.