The bill had earlier this week gotten the backing of a slew of internet heavyweights.

The Reform Government Surveillance coalition – which includes Facebook, Apple, AOL, Google, Yahoo, Microsoft, Dropbox, LinkedIn, Twitter and Evernote – released an open letter to the Senate that called for passage of the USA Freedom Act, which it said would both protect national security and reaffirm the country’s commitment to “the freedoms we all cherish”.

The rationale for tech companies’ support of the bill was easy to see: Their “Made in the USA” products have become tainted by fallout from revelations about US surveillance, while overseas governments are working to build data-privacy havens that are giving US technology services and products a run for their money.

In fact, the Information Technology and Innovation Foundation (ITIF) last year estimated that such fallout could cost Silicon Valley up to $35 billion in annual revenue, much of it from lost overseas business.

But even with all that at stake, the coalition still had to hold its nose while it pushed for passage of the USA Freedom Act, given how watered down it had gotten in the House of Representatives.

The USA Freedom Act was first proposed last year by Senator Leahy and Representative Jim Sensenbrenner.

The original version of the bill limited the NSA’s call records collection program, introduced a special advocate into the secretive court overseeing the spying, mandated transparency requirements, and included significant reform of Section 702 of the Foreign Intelligence Surveillance Amendments Act (FISAA) – the law used to collect US persons’ communications in bulk.

The House of Representatives took up the original version of the bill in May.

It gutted the bill’s original privacy protections and wound up passing a new, weaker version, in spite of protests from privacy advocates.

The problems with the House bill included the fact that in emergency cases, it still allowed for collection of records, even without a judge’s order.

And it also didn’t do much to stop the NSA’s continued collection of potentially millions of people’s data, given that it allowed collection of phone call records up to two hops away from a target.

Senator Leahy responded by vowing to move forward a stronger bill – one that would restore some of the meaningful reform that had been cut.

The result: the current version of the bill, released in July 2014, which would have been up for debate in the Senate if it had received 60 votes – two more than what it actually received.

With the bill’s defeat, the legislative process to rein in the NSA will have to restart in January.

The deadline for new legislation is June 2015, when the provision in the Patriot Act that gave legal basis for the collection of bulk phone records expires.