"We don't dismiss employees for exposing privacy flaws, but we do take it seriously when someone misuses user data and puts people at risk," Facebook said in a statement.
"We began developing improvements to location sharing months ago, based on inputs from people who use Messenger. His (Khanna's) mapping tool scrapped Facebook data in a way that violated our terms, and those terms exist to protect people's privacy and safety," Facebook said.
"Despite being asked repeatedly to remove the code, the creator of this tool left it up. This is wrong and it's inconsistent with how we think about serving our community," Facebook added.
Justifying Facebook's move, Supreme Court of India senior lawyer Pavan Duggal said, "Any organization is well within its right to terminate the internship of any individual if an individual has done any contravention or violation of the existing policies of the organization."
He said "given the fact that using the data from Facebook Messenger is subject to terms and conditions of Facebook, the said usage should have been done only with the prior permission from Facebook," Duggal told IANS.
Terming it as a serious offence, Duggal said, "In case such an activity was done in India, under Indian cyberlaw, the intern could be exposed to a claim for damages by way of compensation upto five crore rupees per contravention under Section 43 of the Information Technology Act, 2000."
Echoing a similar view on the issue, cyber law expert and Chairman Lex Cyberia Karnika Seth, while terming it as a serious privacy issue, said "Incidents like these strengthen privacy protection mechanisms on growing social media platforms."
"If the scrapping tool allegedly used by the intern violated Facebook norms, they were well within their rights to cancel internship if such a policy existed there and was followed at Facebook," Seth told IANS.
Khanna, however, told Boston.com that Facebook withdrew its summer internship offer three days after Marauder's Map launched. According to the website, the day after Marauder's Map was posted, Khanna said his future manager at Facebook called him and asked him not to talk to the press.
Marauder's Map was a Chrome extension that used data from Facebook Messenger to map where users were when they sent messages, Boston.com said.