The legislation failed resoundingly but highlighted a growing Democratic divide over whether the United States should withhold some weapons to register its disapproval of Israel’s war tactics.