Dont steal and it wont be a problem.
Saw a
Star Trek: TNG episode where the planet the crew was visiting had a strict set of laws. The enforcement was randomly selected by sectors. If you happened to be in a monitored sector and break the law, you get arrested. If the sector is not being watched, you will not get in trouble. The randomness kept everyone on their toes no matter where they were rather than risk being in the wrong place at the wrong time doing wrong.
Lt. Wesley Crusher was horsing around playing some game of catch or something, and he accidentally fell headfirst into a gardening plot. There was some minor damage, and the sector just happened to be actively monitored.
Oh, did i mention that the punishment for all infractions regardless of severity was the same?
Death!
After a trial and discussion, the planet's leaders decided they could not make an exception for an outsider, so they scheduled his execution. The dilemma was, of course, whether Picard would break the prime "non-interference" directive, or act to save Wesley from such a disproportionate punishment.
When calling for extreme punishments for others, remember how screwed up our justice system is. It might be you arguing for your own life against bogus charges one day. Nowadays, it's just not enough to actually be innocent to avoid punishment.