It sounds to me like the property developers didn't own the land either. So basically it was a quarrel over who had rights to the land, and as the homeless bloke had lived their longer (unquestioned as well), he won the case.
I personally don't agree with people squatting in properties when someone doesn't want them there, but if the owners don't give a shit and don't do anything about it then it's actually quite fair.
Cheers,
Andy