The two-party system isn't so heavily institutionalized "by law". The law generally gives advantages to parties that pull in more than x% of the vote, and it so happens that the first-past-the-post system of electing representatives makes it very difficult for a third party to take root.
Except our law is nothing like that. You can have a party take 45% of each district across the whole country and end up with zero seats in the House (because the other party took 55% of each).
The first past the post system is encoding a two party system into law. If it makes to hard enough for a third party to take hold, there might as well not be one.