Freedom of expression does not extend to the giving or receiving of official secrets. There seem to be two main classes of information kept secret for reasons of national security: information relating to the defence of the realm, and information concerning the activities of the intelligence services.
There is also an argument that the free flow of information may prejudice the Government's position in its dealings with other countries, and another that disclosure would inhibit Ministers, civil servants and other advisers in their role of giving honest advice. These arguments are generally thought to be much weaker.
The Official Secrets Act 1911 was a classic piece of panic legislation - it was rushed through Parliament in a single day, with barely an hour's debate, in response to a spy scare. It survived for nearly eighty years even so, and its notorious section 2 made it an offence for any Government employee to disclose without authorisation any information acquired in the course of his work.