WASHINGTON—The House on Thursday narrowly passed a bill curtailing spending on food stamps, setting up a battle with the Senate, which backs far smaller cuts. The vote was 217-210.

The bill would cut nearly $40 billion over a decade, or about 5% in expected spending, from Supplemental Nutrition Assistance Programs.

The Senate has called for...