There is absolutely no way this should be asked. Ignoring the illegality of it at present, if someone is the best candidate for teh job they remain the best candidate for the job regardless.
What of the people who take a job as a stepping stone and stay for a year then move on permanently?
Unless you can afford - and want to! -hire a surrogate there is no option except for women to have children. Men are physically incapable. They should not be penalised for it. I'm always furious stunned by the posters on here who tell women they must tell they are pregnant at interviews. Until men are told the same and treated in the same way for becoming/planning to become parents it's utterly wrong.
It's also part of this subscription to the idea that having children will make women less valuable employees while men won't be affected or will work harder and THAT is something we as women need to do something about. I know in my personal experience that having children made me determined to work harder than ever, firstly to set a good example and secondly in order to ensure I could be financially stable on my own for their sake, if it was ever needed for any reason.
It will only really become fair when maternity leave can be equally split, and commonly is split, between mothers and fathers. (so not really maternity, more parental leave then).
Another point - what if women are in a same sex relationship? Their plans to have a child could be utterly irrelevant to the employer as they may not be the one who carries the child - but the employer wouldn't be allowed to ask that would they?