President Barack Obama's meeting Tuesday with tech titans was billed as an opportunity to chat about HealthCare.gov, the government's efforts to improve technology procurement, income inequality, and oh, "national security" issues.

Don't be fooled. After the president's joke with Netflix (NFLX) CEO Reed Hastings about "House of Cards" ("I wish things were that ruthlessly efficient," he said about the TV series set in Washington) and the doors were closed, the real discussion during the two-hour meeting was all about the tech industry's outrage over the National Security Agency's controversial surveillance practices, according to reports that leaked afterword.

And, more important, the meeting, which included Tim Cook of Apple (AAPL), Marissa Mayer of Yahoo (YHOO), Dick Costolo of Twitter, Google's (GOOG) Eric Schmidt and 11 others, comes as the once-close relationship between Obama and the tech industry has hit the rocks, riven by what appears to be genuine disgust at companies like Google and Facebook and Twitter over intelligence programs that they feel have put their reputations and businesses in serious jeopardy.

Despite the bad blood, both sides still need each other.

Facing tough midterm congressional elections in 2014, Obama is counting on the tech industry's financial support as he tries to hold on to a Democratic majority in the Senate and fight back the GOP domination of the House. He also needs its help keeping legislative priorities, like immigration reform and the health care law, moving forward. To that end, the administration announced Tuesday that it had tapped former Microsoft executive Kurt DelBene to take over HealthCare.gov.

And there is Obama's post-White House life to consider, says Bill Whalen, a research fellow at the Hoover Institution and onetime speechwriter for former California Gov. Pete Wilson.

"Does he want to be in Silicon Valley and part of the tech community? Will they welcome him into the board room? These are relationships the president cannot afford to burn," he said.

The tech industry has its own reasons to see the relationship repaired. Most critically, the industry wants major reform of the surveillance program.

And there are other tech policy priorities, such as the immigration measure that is stuck in the House, as well as patent and tax reforms.

The relationship started out as a romance, with both candidate Obama and the tech industry embracing each other as the new new thing. Silicon Valley lavished money and its technical expertise on the president's campaigns. The president decided to make his mark by using tech as a way to make government more transparent. He appointed the first federal chief technology and chief innovation officers.

From Steve Jobs to Intel's (INTC) Paul Otellini, the industry's iconic leaders have been ready props for the president to hold up as examples of American ingenuity, expertise and economic strength.

"The tech sector has fawned over Obama for years now and showered him with bags of campaign cash," said Adam Thierer, senior research fellow at George Mason University.

Sure, the industry hasn't always felt it's had a seat at the table in Washington. In his first term, the industry's high expectations for the Obama tech agenda were bound to be disappointed, even as it won a huge victory in a copyright legislation battle with Hollywood and also saw passage of the JOBS Act, which gave private firms more flexibility when raising funds and was supported by Silicon Valley venture firms and startups.

Obama's second term started off on a more promising note, with progress on immigration reform in the Senate and the administration's backing of patent reform.

But the NSA revelations have pitted the tech industry against the administration, with the highest-profile breach coming in November when major tech companies, in a letter to Obama and Congress, demanded sweeping changes to the NSA and a ban on bulk collection of data.

Can this marriage be saved?

It's unlikely the meeting in Washington will be enough, despite the soothing words afterward. Some of the tech companies released a joint statement saying, "We appreciate the opportunity to share directly with the president our principles on government surveillance that we released last week and we urge him to move aggressively on reform."

And according to a White House statement, the president "listened to the group's concerns and recommendations, and made clear that we will consider their input."

Sounds like a promising step, but both sides need to work to rekindle the romance.

Contact Michelle Quinn at 510-394-4196 and mquinn@mercurynews.com. Follow her at Twitter.com/michellequinn.