Look at it from the other way around - if you were to enter someone else's property and steal, would you expect to be sent to prison for being caught? If yes, would that seem fair? I would say yes.
Would you expect to serve time for being caught riding a bicycle on a pavement? No. Otherwise would not seem fair, particularly if there were no warning signs...
The law is a system with predictable penalties if you a) don't live somewhere with utterly absurd laws and b) can put yourself in the shoes of the person doing such a crime and think about the expected outcome of getting caught.