People seem to think they can ask you just about anything when you tell them you're pregnant. Most of their questions are really insensitive, offensive, or none of their business. For example, asking if my partner and I were trying to conceive or if my pregnancy was "an accident." Honestly, asking me if my baby was "planned" makes me cringe for so many reasons.
Not only is it really no one's business whether my husband and I were (or were not) trying to get pregnant, but unintended pregnancy is not something to be casual about. You have no idea what anyone is going through, and there are so many reasons why this question might make the person you're asking uncomfortable. My last pregnancy was complicated and risky. I was so sick for most of it that I thought I was going to die (and sometimes I wanted to). I felt so guilty about not being happy about a planned and wanted pregnancy, especially when so many of my friends have issues with fertility and have suffered losses. To make matters worse, so many people asked me if it was planned, and when they they did, they assumed the answer was no because my partner and I already had four kids. I felt like they thought my pregnancy and family size were something to joke about, and that's not OK.
For others this question might be harmful because their pregnancy was unplanned. They might be unhappy about it. They might be contemplating abortion. They might be silently freaking out about what to do. They might just be hypersensitive regarding other people's preconceived notions about unplanned pregnancies. Your question might embarrass or shame them for having an unplanned or unwanted pregnancy, which is a really crappy thing to do. Another person's pregnancy might be the result of significant planning and fertility assistance, which is nothing to joke about, either. Their baby might be a rainbow baby, or their baby might be adopted.
My point is, no one owes you an explanation about how or why they got pregnant, had a baby, their fertility, or their family size. For these and so many other reasons, people really need to stop asking if babies were planned. It's rude AF.