They're likely asking because they've already hired people who expect to be able to come in late after taking their kids to school, work from home without notice if their kids are sick, etc.
I know this is an unpopular opinion, but: To me that's reasonable employer's discretion. If they're expecting you to work after hours and probing if you have kids to gauge that, that's one thing. But I've seen coworkers get allowances for kids for all kinds of things. Both parties (employee and employer) should be aware of what the expectations are ahead of time.
And if that means that I (as someone who doesn't have children, or lives near additional family who can handle those contingencies) come out as a better candidate, then that's not unreasonable.