Bearing in mind that this is the Law section, and therefore moral considerations are secondary, it might be better not to get too far down the rabbit hole about the moral question of hiring pregnant women or not. Women are, I believe, expected and required to inform the employer they are pregnant with at least 15 weeks' notice of the due date, and so in that sense it seems courteous to inform prospective employers at interviews, but not obligatory at such an early stage.
The simple fact is that under current law, women are not obliged to reveal their pregnancies, and employers who take pregnancy as a reason to fire an employee, or deny a candidate a job, would be risking criminal action. I hope that those who say they wouldn't hire pregnant women (regardless of their ability to do the job) are speaking only hypothetically, and certainly I hope that they aren't encouraging employers to break the law.
It's also worth pointing out that paternity leave is a thing, so the argument that "No-one would expect a man to take a job knowing he was likely to leave it within months for up to a year and expect his post when he returned" is incorrect. For obvious reasons, the mother is currently entitled to more leave than the father, but both enjoy the protection of the law on matters of pregnancy.
If one wants to discuss the morality of the law, and whether it is unfair to employers or not, then this isn't the thread in which to do so.