Historically these laws exist because US law is based on English common law. I’d bet a Loonie that they exist in Canada as well for the same historical reason. If you live in a former British colony, it may be worth your time to get a basic understanding of common law.
- Duty Owed Trespassers (emphasis mine):
A landowner has no duty to keep premises in a safe condition for the benefit of trespassers. An owner does not possess any duty to a trespasser under the traditional common law view except to abstain from willful or wanton misconduct or entrapment.