Yeah, it has always been a bad idea.
That reminds me of the 19th Century Zulu king Shaka, who reportedly kept his soldiers in a compound, separated from the rest of the people, and refused to allow them to marry until they were in their forties. If an unmarried soldier got a woman pregnant, they were both executed.
That is a little extreme, but I could see discharging him under less than honorable conditions. Maybe a BCD.
The King had the right general idea.