People avoided unwed pregnancy because it was nearly impossible to hide and everyone would know. People that could hide and get away with it did.
People wear seatbelts because they are immediately visible and you will get a fine the moment a cop glances at you. New cars also come with annoying alarms. I only wear mine because they are proven to be safer and would cheat the law with a fake belt if they were not.
Nearly invisible crimes like possessing a coin-sized baggy of drugs will never be stopped by laws because the chance of being caught is almost nil. People will never respect laws that are nearly unenforceable and go against their own knowledge.
I go back to the 60’s, so the drug laws did fine until the cultural norms were challenged and then the injurious behavior was challenged and promoted in the media, the institutions, and the arts.
That society had received willing compliance with good laws because they were a wiser people. This only changed when their culture was attacked. I think by agents of evil. The liberals would say that were expanding folks’ horizons. In the garden, the serpent said the fruit would actually be good, expanding their horizons, despite what God said.