The partisan vote was a defeat for Senate Democrats and gay rights advocates, who saw the bill as their last chance before November's elections to overturn the law known as "don't ask, don't tell."