In a rare act of bipartisanship, representatives approved the legislation in a 313-to-118 vote that defied free-market conservatives.