You are putting things in the wrong perspective
When you cross the road without using the pedestrian crossing, you
endanger not only your life, but others as well. With that, its of
course correct to impose a law to tell you to cross at a pedestrian
crossing for the safety of everyone using the road.
Your example is out of context.
Another example?