J.B.
It is quite possible he 'forgot' the rule, in the heat of the moment. The other boys saddled up and yelled "let's ride.." and he followed the pack. That is understandable, IMO.
The punishment is fitting, I thing the length of time may be a little excessive. As far as going forward, get down on his level, look in his eyes and say "do you remember the rules..?" Have him repeat them to you (we do this) and if he violates them again, the punishment he gets is easier to deal out.
You handled it well. I know it's summer and you want them to have their freedom.