The practice known as "Gendercide" often involves aborting a baby girl because of a preference to have a boy. It's most common in some Asian countries where families wanting sons abort female fetuses.
The vote came just days after a pro-life group released undercover video calling attention to the issue of sex-selected abortions.
The measure would have imposed possible fines and possible prison sentences on doctors who knowingly performed abortions based on sex. The ban failed to get the two-thirds majority needed to pass.
The White House, most Democrats, abortion rights groups and some Asian-American organizations opposed the bill, saying it could lead to racial profiling of Asian-American women and subject doctors who do not report suspected sex-selection abortions to criminal charges.
The bill had little chance of becoming law because the Democratic-controlled Senate would likely have ignored it.
Rep. Steny Hoyer of Maryland, the House's No. 2 Democrat, said he thought the bill was introduced because "somebody decided politically that this was a difficult place to put people in."
The Associated Press contributed to this report.