Yes they are breaking Jedi rules but no others.
If you want to get married (even in secret) then someone has to make it official or "proper" be it a priest, other religious official or someone with the legal authority to do so.
In this case,
the ceremony was officiated by a Pontifex of the Brotherhood of Cognizance named Maxiron Agolerga who presumably could be relied upon to keep his mouth shut. *
* Probably not the case with C3-PO
The very fact that they are in a relationship breaches Jedi rules, making it official just makes it harder to undo.