I believe it is legal
I am not aware of any FAA requirement that there be an operable toilet on the plane. I believe that United would refund the ticket if you chose not to fly on that aircraft. If you would chose not to fly, I would have the 1K desk cancel the reservation and note in the record the reason, I would then e-mail 1Kvoice to get the refund processed. If they bulk at it, I am sure a letter to WHQ explaining what a wonderful news story this would be about United forcing people to fly with "no way to go" would get their attention.