My guess is that it has something to do with boundaries and restrictions, which innately forces a kind of discipline on artists to be more creative. Artists loathe boundaries, but without them, they more often than not flail and wind up pleasing no one but themselves.
It’s not lost on me that most of America’s cultural heights coincided with the years the Hays Code was in effect.
One needs only look at contemporary painting, poetry, etc to see the truth in that.