Dragon Ball Z fans still debate whether Goku is a good or bad father, with his decision to have Gohan fight Perfect Cell often brought up as support for the latter side. On top of placing the entire world's fate on his son's shoulders, the confident Goku even tosses Cell a Senzu Bean to ensure he's fully powered up to fight Gohan.
All the other Z fighters, Gohan and Cell himself, are incredulous. How could Goku be so arrogant as to send his -- at the time -- only son into a battle he can't win and then revitalize the enemy to boot? It was very harsh, but a closer look at the situation -- and the source of Gohan's power -- shows that Goku did indeed make the right decision.
While training in the Hyperbolic Time Chamber with Gohan, Goku understood how his son's power worked. Gohan's ability to ascend past a Super Saiyan had emerged, but only if he was in the most life-threatening situation possible and his deepest rage was triggered. Goku himself was unable to make that transformation at the time, so he figured it was unlikely he could defeat Cell on his own. Knowing the other Z fighters weren't strong enough -- or fast enough in Trunks' case -- he expected from the start that Earth's fate would rest on Gohan's young shoulders.
This is why Goku fought Cell first (after Mr. Satan failed to finish the job) despite knowing he couldn't win. He wanted to ensure Gohan could follow all of Cell's movements and study his fighting style. That way, there would be few or no surprises when Gohan's turn came around. Of course, Goku tried his hardest to defeat Cell himself. His instant transmission and Kamehameha Wave combo would've obliterated nearly any other opponent -- except one who could regenerate if even one tiny cell is left alive.
Gohan is a pacifist at heart, so Goku needed to create the most dangerous and difficult situation possible to awaken his son's latent power. Charging Cell up again via a Senzu Bean was part of the plan. Had Gohan entered the fight against a weakened Cell, his mental approach would have been very different, and his anger would not have been triggered. The normal Super Saiyan Gohan's powers combined with his lack of fighting experience would have almost certainly ensured Cell's victory. However, by pummeling Gohan for a while, then sending the Cell Juniors to attack his friends and Android 16's dying message, Cell triggered Gohan's innermost power as he ascended to SSJ2.
Goku also needed to keep his plan a secret from everyone else as long as possible. Though Gohan figured it out during the fight, had he known beforehand that he'd be Earth's last hope, he would've been plagued with self-doubt and unable to focus on watching Goku's fight properly. It wasn't a great look for Goku to remain smiling the entire time Gohan was getting a beatdown, but he (mostly) knew what he was doing all along -- though he didn't anticipate SSJ2 Gohan's arrogance and the subsequent consequences.
If Gohan defeated Cell at maximum strength, it would leave no doubt in Goku's mind that there was someone stronger than him on Earth, and he could stay away to protect it -- and his friends -- from threats that targeted him specifically. Goku probably didn't win any father of the year awards for his actions, but it was the only hope to defeat Cell and save humanity.