Google chairman Eric Schmidt lobbed harsh criticism at NSA surveillance on American citizens.

“Just because you can do it, doesn’t mean you should do it,” Schmidt said during a hearing in Palo Alto, Calif. hosted by Senate Finance Committee Chairman Ron Wyden (D-Ore.).

The hearing on Wednesday came weeks before a potential Congressional vote on the USA Freedom Act, a bipartisan bill that would stop the NSA from collecting the phone records of U.S. citizens. The event was designed to gin up public support for the legislation while giving Silicon Valley executives a venue to vent about how recent revelations about government spying threaten their businesses.

For years, Sen. Wyden had suggested the NSA was engaged in questionable surveillance practices. But it was not until former government contractor Edward Snowden leaked top-secret documents last year, confirming widespread monitoring of online communications, did the issue gain worldwide attention.

“In 2011 on the floor of the United States Senate, I warned that people were going to be stunned and angry when they found out how the U.S. government has been secretly applying its surveillance authority,” Sen. Wyden said. “And it turned out I was right about that.”

The event, held in the gym of Palo Alto High School, was carefully choreographed as an outlet for outrage at government surveillance. Executives were uniformly critical of the NSA, mostly answering softball questions lobbed by Sen. Wyden, who had attended the school long before the Internet industry grew up around it.

The scene, itself, was a bit surreal. Over 100 high school students sat on the basketball court in the bleachers as executives spoke and, at one point, interrupted the proceedings by leaving en masse after the school bell rang to signal the end of a class period.

Joining Schmidt were Microsoft Executive Vice President Brad Smith, Facebook General Counsel Colin Stretch, Dropbox General Counsel Ramsey Homsany and John Lilly, a venture capitalist with Greylock Partners.

Revelations about the surveillance have tarnished the reputations of many Silicon Valley companies. Some documents have suggested that U.S. tech giants were complicit in handing huge amounts of customer information to the federal government, an accusation that the executives vehemently deny. Rather, they say they only respond to legal demands for user data. Any wholesale surveillance, they insist, was done without their help or knowledge.

Whether the companies should even be collecting so much personal data never came up. Digital rights groups have been particularly critical of the practice, saying it leaves users vulnerable.

“You own the email or text messages or content you create,” Smith said, eliciting applause from the audience. “Even if when you put your content on our data centers, you still own it, and you’re entitled to the legal protections from the Constitution. That’s one of the reasons we need Congress to act.”

Many tech executives have voiced concerns about customers defecting to other services or foreign companies avoiding their products because of the NSA surveillance. To them, the issue is more of a matter of profits than a legal debate.

U.S. tech companies could lose as much as $35 billion through 2016 because of canceled contracts and opportunities stemming from the NSA scandal, according to the Information Technology and Innovation Foundation.

According to a report released by the Open Technology Institute in July, 26% of Americans polled said they began shopping and banking online less after learning of the NSA’s activities. Meanwhile, countries like India, Brazil and Germany have since argued for so-called “data localization.”The practice, if enforced, would require tech companies to store data in countries from which it was collected. Data for a Facebook user in India, for example, would have to remain in that country where it would, in theory, be safer from U.S. spy agencies. As it is, U.S. tech companies like Google and Microsoft MSFT store data where ever they want.

Storing data internationally would not only increase company costs for new servers that must be based in those countries but also cut demand for U.S. workers — a scenario tech companies like Facebook FB , Google GOOG and Yahoo YHOO want to avoid. Indeed, executives like Schmidt and Stretch have a vested interest in keeping the status quo.

Facebook General Counsel Colin Stretch contended the practice creates other problems beyond financial like slower service and new security loopholes, among others.

“The Internet is a medium without borders, and the notion you’d have to place data and data centers used to serve particular countries within the region is fundamentally at odds with the way the Internet is architected,” he argued, saying the result would be a Web that is slower and less personalized.

Schmidt echoed those comments, saying “I think the simplest outcome is we’re going to end up breaking the Internet.”