The process was as questionable as the result. The provision was smuggled into an unrelated bill on metal theft, and at one point the Senate voted to bypass a good-government rule requiring it to end voting at 11 p.m.