I have been fortunate enough to have a couple of visits to the cockpit on a 747 - once was at LAX when there was a major immigration computer shambles and we were held on board for something like 3 hours before being allowed to disembark, and the second was last year coming out of PHX. On the first occasion I asked the FO while he was wandering around, and the second I asked the CC who asked the Captain. I've also had a couple of visits to the cockpit on the Airbus 319 / 320 due to ATC delays.
On the PHX visit it was pre-departure and the CC said that that Captain was fine with it but that the SFO would come and get me (and my g/f's daughter) when they'd completed their paperwork etc. For me, it was really interesting to see the waypoints in the FMC and the fact that the routing was generally a lot more southerly when flying east than west.
Personally, I think it's great for kids (of all ages) to be able to see the fun end of the plane. I think it can be very inspirational from a career point of view (whether that be engineering, avionics, ATC, flight crew or whatever) and as long as it's not causing a delay or impacting security then I really don't see why people get so worked up about it. I think some people forget what it was like to be a child.