WASHINGTON—Congress on Thursday passed a two-week stopgap spending bill, deferring until later in the month a bigger fight over what issues should be resolved before lawmakers leave Washington for the year.

The spending patch, which will keep the government funded through Dec. 22, avoids a partial government shutdown just over a day before its current funding expires at 12:01 a.m. Saturday morning.

The...