In a closely divided House of Commons, MPs voted 286 to 270 against legislation