ExPratt- I'm under 25, and I agree with you fully. If you walk into FBI Headquarters and cause a serious distraction, you'll probably be arrested. If you walk into a cockpit during flight and cause a serious distraction, you just might take your own life plus the lives of everyone on the plane with you.
Singapore_Air, if banning cockpit visits to protect passengers from wackos is "stupid and immature", then might I only say that you are acting like the practice you just described. The FAs don't have time to do a friggin' cavity search on everyone who wants to go into the cockpit, and even if they did, it'd be a huge inconvenience to pax. I approve fully of the locked cockpit door during flight, with only the head FA and the pilot/copilot/flight engineer (if one is present) being given the key.
Now, on the ground at the gate, there's really no reason you can't go into the cockpit and look around. Don't forget, however, that whether you visit the flight deck or not is entirely up to the pilot- it's their plane, and if they say no and you raise a fight, I applaud flight crews that kick you off.