For a lot of people, children give "meaning" to their lives or make their lives "better." They would possibly lack a sense of purpose without them. You could argue this is selfish, coupled with the fact that they're bringing someone into the world without a choice or their consent to do that. But they would probably counter that with "life is a gift," or something. However, you could also argue that raising a child well is an unselfish/selfless act. I would agree with either perspective there.
Giving life meaning is an important thing for humans because we seek an intrinsic purpose. A purpose can be hard to find but having a child can certainly fill that void. Once we hit 40, it's pretty much--been there, done that as far as experiencing life. However, there are ways besides having your own children to fulfill that void of needing a purpose. When we're young, things such as running can give us purpose. The fact we don't know where we are headed and are establishing our way of life provides uncertainty and excitement simultaneously. That excitement can be lost in the mundane nature of existence. Other ways to feel a purpose are to help others in some capacity, which mimics the art of caring for a child of your own. So if you don't have your own child, you can perhaps spend time with your nieces or nephews or volunteer to help kids somewhere. Helping others young or old and volunteering can fulfill this human need to find a purpose without having your own kids.
Having a kid is sort of like running, it has it's ups and downs but unwavering commitment is key to being a competent parent. There's so much bad parenting out there-though every bad parent pretends they're super mommy on social media-the social media super mommy is a lot of times a red flag as it's selfish in nature (all about mommy). With this noted, I have immense respect for anyone who is an actual good parent, who genuinely cares for their kids and fulfills their emotional needs as well.