McMaster is the second national security advisor to leave the Trump administration in just over one year.
The legislation now goes to the Senate, where it is expected to pass with bipartisan support.
Paul Ryan promoted the $1.3 trillion plan to fund the government through September as President Trump was reluctant to support it.
Racing against a looming government shutdown, Congress hurries to vote on a massive $1.3 trillion spending bill only hours after its release.
The White House plans to announce tariffs Thursday as President Donald Trump aims to punish China for intellectual property theft.
Congress has reached a preliminary agreement on multiple points of contention over issues such as immigration and infrastructure.
Big money has flowed into Tuesday's fight for longtime centrist Democratic Rep. Daniel Lipinski's Illinois 3rd District seat.
Lawmakers have until midnight Friday to approve a spending bill, or the government's spending authority will lapse for the third time this year.
Possible tweaks include making individual tax cuts permanent or changing capital gains tax policy.
The action deals a blow before the midterm elections to the GOP, which benefited from a map it drew.