The government had imposed a three-line whip on the crucial vote meaning Tories who failed to oppose it could face punishment.