The doctor is absolutely right! Even if you're not pregnant, no human should ever crawl through the X-ray machine!
The metal detector is fine, as everyone else has stated.
The important words to note are in bold. They are two totally different things.