if i worked in an office i wouldnt want every tom dick and harry walking in
But that's not a valid comparison. In the days before the Dft issued this draconian edict the only people allowed on the flight deck were those that were permitted to by the Captain - hardly "every tom dick and harry". Now even my son is not permitted access to the flightdeck with my permission.
Of course the rules should be obeyed but it's a stupid rule that doesn't allow the Captain discretion,