If you match, then you can only sign the contract of your match. To do otherwise is a match violation. You can't go to jail for this, nor be sued for $$$ -- if you were to do it, you'd be barred from the match for some period of time. You may not care about this (i.e. if you have no interest in a fellowship), but the program that signed you could also be found to be a match violator, and they could be barred from the match.
If you didn't match, then you can do anything you want. You can sign 5 contracts. If you sign a contract and don't show up, there really is nothing a program can do. Heaven help you if you try to get a job at that institution in the future and they remember you, though.
The best ethical thing to do is this: if you sign a contract outside the match and then get a better offer, take the better offer and notify your first program that you are no longer interested. I don't see any benefit to keeping multiple active contracts.