For example… Speeding
Going down the highway doing 10 oven the limit and you get pulled over an dgive a hefty ticket… But Nothing bad happened.
Another example… Letting a Tesla do full self driving but you aren’t paying attention. The car is driving itself quite well but you are ticketed for undue care and attention… But there was no accident or anything… Nothing happened.


To actually answer the question: because bad things happened.
First of all, this is a public road used by a lot of people. This is a shared space/resource that we all want to benefit from, and that means that it needs to be safe for everyone to use it (otherwise, people are not going to use it and thus no benefit from it).
By speeding (or letting a Tesla do the self-driving without paying attention), they broke important rules. The other point is that had there been an accident, then we would have punished the person for the accident too.
We can argue about whether a given speed limit is adequate for a given stretch of road, but the core of it is that someone (usually experts) settled on a speed under which it is safe to travel. Going above that speed means that you are now taking on more risks than accounted for when designed.
Why is breaking these rules bad? Because, for example, normalization of deviance. The long-story short is that safety rules are an important part of keeping a system safe, and ignoring them removes the safety margins built into the system and either makes accidents more likely, or makes any accident that does happen more disastrous.
To stay around the speeding example, consider the following: people take a set amount of time to react. The faster you go, the more distance you need to react. If you are traveling down a road, and an animal crosses 100 meters ahead, the faster you go the less time you have to react.
Also consider the following: roads are not perfect. If you go over a patch with sand, or a recently-rained-on surface, you may end up with much less grip than you thought you did, and you end up spinning on the turn, or not breaking enough. And you won’t know you need it until you do, and now you’re too late to not speed.
If you were on a private road? Good luck. Its on you. But you are in a public space, and it’s likely you’re putting others at risk, either directly, or by (as linked above) normalizing deviance and making it more likely for others to not follow the rules when it matters.