It is generally illegal for sites to put up past papers. The exam boards write the papers and so they are the copyright holder, this generally means you can't copy entire papers anything from the paper (except under fair use policy). However as people need past papers to revise, the exam boards copyright policy allows schools and educational institutions to make as many copies for their students.
It's not totally clear whether putting papers up on the internet is acceptable or not. Sites like Mr hughes put up papers protected by a password designed to only allow people access from his school, but as everyone knows the password this dosn't work. I am not a laywer, so can't give you a proper answer.
However sites which let anyone access papers and arn't controlled by an educational institution are definatly illegal.
On another notes copying answer papers in any form is illegal, teachers can make their own answers available, but the exam boards dont allow thier answers to be copied.