WATCH every match of the FIFA World Cup 2022 LIVE and FREE on SBS and SBS On Demand
Didier Deschamps' side became the first defending champion since Brazil in 1998 to return to the final at the next edition with another efficient performance at Al Bayt Stadium.
Hernandez struck as France raced into a fifth-minute lead against Africa's first World Cup semi-finalists, although Morocco were in the ascendancy for large parts.
That pressure brought no reward, and substitute Kolo Muani's 79th-minute second ensured France's bid to become just the third side to retain their global crown continued into Sunday's final against Argentina.
Hernandez fired France into an early lead after Kylian Mbappe twice saw efforts blocked, the second deflection falling to the left-back to expertly finish at the back post.
Olivier Giroud smashed a left-footed strike against Yassine Bounou's right post before whipping wide from a glorious opportunity after Jawad El Yamiq denied Mbappe with a last-ditch clearance.
El Yamiq almost levelled with a sensational overhead kick from Hakim Ziyech's corner on the stroke of half-time, only to be denied by a stretching Hugo Lloris and his right post.
Raphael Varane produced a vital intervention to thwart Youssef En-Nesyri after the interval as Deschamps' men were pinned back, before France sealed victory with 11 minutes remaining.
A deflected Mbappe strike rolled into the path for Kolo Muani, just off the bench, to tap in at the far post as Morocco's fairytale run came to an end.