A measure to ban abortions based on the sex of a child failed Thursday to earn enough support in the House, and abortion opponents said they plan to use the vote to paint Democrats as disingenuously supporting women’s rights because they voted against a bill protecting unborn baby girls.