census records are public records and it is free to search the released returns in person that have been filmed by the GRO.
However, the indexes as a whole that are accessible online have been purchased at great cost by various genealogical research companies, like ancestry.co.uk, findmypast etc. In many cases they have had to also transcribe AND index the returns supplied which all costs money. If they have bought the returns already indexed then that is mor eexpense for them.
They are businesses and have to charge. If you do want to search for free you can use the ancestry.co.uk library edition at your local reference library, you just need a library card.
also, the 1881 census index (which was a massive voluntary project carried out in the 1990s by volunteer transcribers and checkers under the direction of the LDS Church) is avialble to check free at familysearch.org, but remember it is a transcribed index only not the primary source