Its a pain in the arse rule but a sign of the times unfortunately. Passengers seem to have accepted it and many nervous fliers I'm sure are glad that strangers are no longer permitted onto the flight deck.
I agree, in the past many drunk passengers have or have tried to get access to the flight deck. The cabin crew would normally have tried to "vet" who was allowed up.
The rules for cabin crew admittance to the flight deck are likewise draconian & cumbersome but necessary. It initially enhanced the feeling of solitude in the cockpit and cabin crew visits are more infrequent now unfortunately due to the entry procedures.
People adapt though to environments and the system now feels normal to me. Some operators still allow passengers to poke their head into the flight deck after the flight when the engines are shut down so it is not a total "no go" area.