Senate Republicans killed the bill on Wednesday night on a 56-42 vote that denied the measure the 60 votes needed to advance it to full debate and a vote.
Majority Leader Harry Reid, a Democrat, had delayed the vote to give McCain's Democratic rivals, Sens. Hillary Rodham Clinton and Barack Obama, time to return to Washington to support the measure, which would make it easier for women to sue their employers for pay discrimination.
McCain skipped the vote to campaign in New Orleans.
"I am all in favour of pay equity for women, but this kind of legislation, as is typical of what's being proposed by my friends on the other side of the aisle, opens us up to lawsuits for all kinds of problems, the expected Republican presidential nominee told reporters. This is government playing a much, much greater role in the business of a private enterprise system."
The bill sought to counteract a Supreme Court decision limiting how long workers can wait before suing for pay discrimination.
Democrats criticised McCain for opposing the bill.
"Senator McCain has yet again fallen in line with President Bush while middle-class families are falling by the wayside," Clinton said in a statement following the vote.
"Women are earning less, but Senator McCain is offering more of the same," Clinton said.