The general reason is to prolong the survival of our species. At the individual and societal levels, we manufactured different more immediate reasons for achieving that general reasons.
For many people and societies, it varies, but here are some decent reasons people have and raise children:
1. Pass a legacy. Along with ritual and tradition, legacy is a reason our life has some meaning. Without these things, we'd all be nihilistic emo wanderers with no purpose since the reality of our insignificance in this vast universe is depressing. The idea of keeping ourselves alive and passing it on to a new generation is comforting.
2. Share a relationship with someone at a level that can't be easily replicated by just meeting people. You know how there is just an instant love for many parents (most I would say despite all the terrible things happening in the news, because most animals are wired to want to care for their offspring in order to survive as a species). There are literal chemical reactions going on in our brain when skin to skin contact occurs between child and parent (yes, both mother and dad). And down the line, the relationship only strengthens as one party needs so much in order to grow while the other has all the responsibilities of nurturing that child. They can't help but have a relationship that is defined differently than every other kind you will ever have. It's kinda the cutest parasitic relationship you'll ever see.
3. It feeds the ego. A lot of people love themselves and would like to see themselves in another human being (not talking about sex, get your mind out of the gutter). Seeing that mirror image or even a few features makes a person feel great.
4. Some people are naturally nurturers. Whether it's pets or children or whatever, some people want to share their love with someone they can nurture and kids are perfect for that.
I guess that's all I got off the top of my head. And these aren't necessarily reasons why I would want a child. Just that I am aware of how some other people think. I'm sure a lot of people who have even more different reasons.