If you have a swimming pool in your back yard, but no fence, there's always the chance that some neighborhood kid will sneak into your backyard and drown in the pool, and that's YOUR responsibility. It's what's called an 'attractive nuisance'.
Unoccupied buildings can also be an attractive nuisance. In addition to squatters moving in, people looking for something to steal, vandals, dopers, etc., kids like to explore old abandoned spaces. So you do what you can to keep them out.