It was loosely based on Brave New World. Although in BNW everyone was fucking all the time and on drugs. Also no one was frozen and there were much fewer gun fights.
BNW was about encouraging hedonism to control the population. Much of demolition man was about suppressing all of that, combined with excessive political correctness through government overreach.