Idk why they changed it in the show. Gendry was KNIGHTED by Beric, not given to Melisandre!!!! (Heck, Gendry who's shy around prostitutes and a cautious person in the books would not sleep with a random person he just met, especially one who works for a social class he's resentful towards.) Plus the BWB needed a smith anyway.
"Every night Arya would say their names. 'Ser Gregor,' she’d whisper to her stone pillow. 'Dunsen, Polliver, Chiswyck, Raff the Sweetling. The Tickler and the Hound. Ser Amory, Ser Ilyn, Ser Meryn, King Joffrey, Queen Cersei.'"