In January 2014, I was released from a maximum-security prison in the middle of a desert in the United Arab Emirates. I had been imprisoned for nine months, all but two weeks without a conviction. The reason? UAE authorities accused me of threatening the country's national security by creating a sketch-comedy video parodying teenagers in Dubai and posting it on YouTube.

I grew up in Dubai, having moved there a few months before my second birthday in 1986. My parents were Sri Lankan expatriates, of that generation of foreigners from all over the world who helped build Dubai. Dubai was a wonderful place to grow up, especially during the 1980s and 1990s when communities were more organic and the pace of life was less frenetic. My friends, neighbors and classmates were of almost every nationality, and we formed a bond that is still going strong in a tightly-knit Dubaian diaspora. Dubai was the only home I knew, but with no chance of naturalization or permanent residence there, my family emigrated to the United States when I was 16. We were warmly welcomed, and we proudly became US citizens.

I decided to move back to Dubai after I graduated from university in 2006. Its economy was booming, and I wanted to go back to the place I thought of as my hometown, to continue my parents' work and make my own contribution to the city I had seen grow around me. For six years, I worked for Emirates Airline – the city's flagship company – and then for a consulting firm, doing my part to build up Dubai as an aviation hub and tourist destination. I didn't have the kind of salary or the perks that Westerners have been known to receive there, but I worked hard to pay my bills and was able to enjoy life amongst old friends in a city I love very much, just like people my age in places like New York or London.

There's a depth and complexity to Dubai's international culture that has been overlooked in news stories about the city's growth over the last decade. In producing my comedy video in late 2012, I wanted to create something that celebrated the charming cultural peculiarities that make the city an enchanting place to live, and to show that Dubai is a much more interesting place than descriptions of it as a soulless artificial desert town might suggest. Dubai's diverse culture is worth exploring, and I wanted to show that Dubaians have the creativity and the sense of humor to create home-grown entertainment that touches upon their own lives as an alternative to the current norm of imported film and television.

"Satwa Gs" were a '90s stereotype in Dubai; teenagers from the decidedly un-gangsta district of Satwa – then popular for the little stores and sidewalk dining along its main drag – who did their best to act like Tupac-era rappers from Los Angeles despite being utterly unthreatening. The video was on YouTube for several months, and I received overwhelmingly positive feedback from Dubaians who were reminded of their own childhoods and thought it was hilarious.

The video made no references to politics or religion, and it didn't disparage the country's rulers – all of which are frowned upon. I had lived in Dubai for most of my life, and I was well aware of the local laws and customs. As a result, my arrest and imprisonment came as a complete shock. I was eventually charged under a vague new Cyber Crimes Law, accused of endangering national security by presenting a fictional image of Dubai.

Just a year earlier, Mission Impossible: Ghost Protocol, which depicted the city as a playground for rogue nuclear-arms dealers, had been filmed in Dubai with government encouragement. Syriana, also filmed in Dubai, made the Gulf states look like a politically corrupt breeding ground for Islamic terrorism. Even Fast and Furious 7, part of a film franchise that glorifies illegal street racing and criminal gangs, is being shot in Abu Dhabi despite road fatalities being a major issue in the UAE. The authorities supported and feted those movies even though they portray the country as a paradise for international criminals, but I was imprisoned, deported, and banned from returning to the UAE for a novice comedy-sketch production about '90s teenagers.

Dubaians aren't robots. They're a dynamic, international, multicultural group with as much talent and creativity as the people of any major international city, and they want to express themselves just like everyone else, sharing stories of their own lives or simply entertaining each other. Discouraging them from doing so with a prison sentence is out of sync with the image of modernity that the UAE tries to project and risks scaring away tourists, expats and international business.

On the other hand, affirming the human desire for self-expression and the breadth of stories that Dubaians have to tell about themselves and their culture would show the world that the UAE has sincerely embraced a progressive outlook. It would reassure those who doubt the authenticity of the country's modern image. Being open to such self-expression would allow the UAE to boost its international reputation and establish an atmosphere that would be far more inviting for the tourism and commerce it seeks to attract.

The ruler of Dubai, Sheikh Mohammed bin Rashid Al Maktoum, stated in a recent BBC interview that my treatment was unsatisfactory and that the UAE would work to "change" any mistakes. His sentiment is appropriate, and I look forward to seeing reform. Prosecuting people for posting comedy videos on YouTube damages the country's reputation and is bad for business, but the UAE now has an opportunity to change its approach.