My bet is that Boehner knew he had enough people to vote against it so that it would fail, but was able to allow some Republicans to vote for it so they could brag in their home districts. A vote that close doesn't come to the floor unless the results were as preplanned as a pro wrestling match.
If a lot of Republicans refused to tell Boehner how they would vote, there wouldn't have been a vote.
More Dems than Republicans got to make ‘show votes’ against it.
So it did them more good, electorally, than the Republicans.