The Dragon Ball franchise has made a name for itself with classic shonen action and the adventures of Goku. Throughout the multiple series, Goku has gone from a small kid to an adult and father. Goku is unparalleled as a fighter and protector, but he is often slated when it comes to familial matters.
Goku isn't winning any awards for World's Greatest Father by any stretch of the imagination, but that doesn't mean he's the worst in Dragon Ball. On the contrary, he does reasonably well given the circumstances. Sure, he was dead for most of Goten's life, but that wasn't permanent, and he spends a lot of time with his sons now that he's among the living again. So while not perfect, Goku deserves some more fatherly credit.
While Goku is best known as being an absent parent, he tries to get his kids in on the training he puts himself through. Chi-Chi wanted Gohan to live a normal life and go to college to get a good job. This idea mostly has roots in traditional Japanese familial standards. The first-born son would focus primarily on higher education to provide for his parents once they reached old age.
In Goku's defense, he had no concept of what marriage was as a child growing up with Grandpa Gohan, nor when Chi-Chi made him promise to marry her. Then she appealed to his love of fighting when they were older by facing him during a martial arts tournament. Goku's latent Saiyan genetics were attracted to her fighting capabilities. So it could be argued his love for her didn't develop until after they were married.
Gohan was four when he was first introduced to fighting, and it wasn't Goku that taught him. After Goku's death, while fighting Raditz, Piccolo saw Gohan had potential, kidnapped him and then left him out in the wilderness to fend for himself. He told Master Roshi, Bulma, and Krillin that he would take this child away from his mother and train him without permission. Goku didn't have a massive say in this, so by contrast, he let Gohan live a normal childhood up until this point.
When it comes to Gohan being in danger during the Namek Saga, nobody knew the galactic dictator Frieza would be on Namek at that specific time. The mission was to go to Namek, find the Namekian Dragon Balls to wish for a new set on Earth and come home. Gohan went willingly and fought willingly. During the Cell Saga, Gohan fought because the entire world was in danger, and he felt it was the right thing to do. Goku trusted his son and saw Gohan as the only one capable of defeating Cell. If it were under normal circumstances, Goku most likely wouldn't have pushed his son into fighting if he didn't want to.
Some fans argue that Goku only cares about his sons when he trains with them, but we don't see many Z Fighter family interactions when the world isn't in danger. There are time-skips and moments between seasons that aren't depicted. Plus, training could be his family's way of bonding. It's no different than a parent bonding with their child over sports or video games. Plus, it's clearly something that Goten enjoys considering he goes on to open a dojo with Trunks -- though that's in Dragon Ball GT.
Goku is absent for large chunks of his sons' lives, but that's because he's usually dead from protecting the Earth. Still, the lessons he teaches Gohan and Goten -- both directly and through his actions -- have seen his two sons grow into admirable heroes. While Goku may be an occasional knucklehead and perpetual fighting machine, it can't be said that he doesn't love his family. Goku may love to fight, but he knows who he is protecting when he's putting his life on the line.