In many countries, such as the United States, laws are published as open data, which anybody can copy and reproduce. In the United Kingdom, only the changes to the law (patches, in computer science terms) are published freely. You can find them on the Office of Public Sector Information (OPSI) website. They are known as acts and statutory instruments. To get the actual “consolidated” law – that is the law which you need to obey – you have to pay a private company for access to a database.
This article about the Statute Law Database describes the ongoing story of a 13 year old government project to make consolidated UK law freely available. However, it has a worrying copyright status. Scroll down to the section “Free access to the laws that bind us?” and read the copyright notice on the pilot website. It isn’t clear yet exactly what restrictions on reproducing our laws the government will make using copyright, but it doesn’t look good.
It seems strange that we have to lobby and campaign to make the law of the land open knowledge. But it looks like we have to.