Virtually every law of this type requires mens rea - meaning that the person who commits the violation has to do so with knowledge of the circumstances.
a rational regulation would prohibit women from drinking with knowledge that they were pregnant.