It isn't just Hamas who's making them stay there. In the 1960's it was the policies of most of the Arab world to shove their undesirables to Palestine, into the refugee camps, and make them stay there. They artificially increased the Palestinian population to far greater numbers than it had been. It was the creation of a people bomb.