Yes, in most situations 'obeying the rules' is what is expected of us.
Obviously from a practical point of view, we may wish to avoid punishment for breaking the rules but there is more to it than that. Are the rules fair, practical and appropriate? Are they social rules that evolved over a long period and that are about maintaining a stable. sustainable society? We may not always see the wisdom of the rules but that does not mean the rules are bad. If we want to change the rules, it is usually wise to work within the rules to achieve the change.
Rules tend to be about 'doing things right' whereas we sometimes need to 'do the right thing'. They are not always the same and it takes experience to know which is appropriate.
In my professional career, it was sometimes necessary to work outside of the rules. Luckily, I had the experience and seniority to do that provided I was willing to take responsibility for the consequences. The rules were there as a statement of principle and to guide those with less experience. If they could make the case for breaking the rules, they were free to seek approval. It was about being effective while managing risk.