Like a lot of great songs, which stick in people's heads, it was written to suggest a lot of things, rather than have a specific meaning.
The public statements by various band members about the song refer to the song being about the loss of innocence, and you can pretty much hang everything on that peg : personally for The Eagles themselves coming to California, knowing first-hand the excesses of the rock'n'roll life and other weirdness - more generally, a comment on American society turning away from a more hopeful, idealistic time into a time of self-centeredness and excess. Also the nightmare feeling of an innocent person, who's arrived in this weird hotel full of decadence and odd goings-on, from which there seems no escape. Also the satanism and drugs references. Also the fact that you can turn almost anything in the song (colitas etc) into a reference to something else, that's also part of the nightmare feeling, that nothing is what it seems.
-edit- 21st March 2020, adding some of the quotes I refer to above
What does "Hotel California" really mean? (And other questions for Don Henley)
“Well, I always say, it’s a journey from innocence to experience. It’s
not really about California; it’s about America,” Henley said. “It’s
about the dark underbelly of the American dream. It’s about excess,
it’s about narcissism. It’s about the music business. It’s about a lot
of different…. It can have a million interpretations.”
Glenn Frey: How Hotel California destroyed The Eagles
"... It is ostensibly about a luxury hotel visit that crosses over to
the dark side - but it is really an allegory about the hedonistic
lifestyle the musicians enjoyed in the 1970s.
Or at least, that's the most popular interpretation. The song was also
rumoured to be about heroin addiction, cannibalism or devil worship
(the album cover allegedly shows Anton LaVey, leader of the Church of
Satan). ... "Everybody wants to know what that song was about, and we
don't know," Frey said in a BBC interview eight years ago.
A decade earlier, he was more forthcoming, telling NBC's Bob Costas
that he and Henley "wanted to write a song that was sort of like an
episode of the Twilight Zone".
"All of our songs were cinematic, but we wanted to open up with [a
montage]," he said.
"It was just one shot to the next - a picture of a guy on the highway,
a picture of the hotel, the guy walks in, the door opens, strange
people.
"We take this guy and make him like a character in The Magus, where
every time he walks through a door, there's a new version of reality.
"We decided to create something strange, just to see if we could do
it. And then a lot was read into it - a lot more than probably exists.
"I think we achieved perfect ambiguity."
When a US spy plane made an emergency landing in China in 2001, the
crew members were asked to recite the lyrics to prove their
nationality. Apparently, their Chinese captors considered that "the
song symbolised America".
Henley would have disagreed. "We were all middle-class kids from the
Midwest," he told Rolling Stone. "Hotel California was our
interpretation of the high life in Los Angeles." In 1995, he referred
to the record as being about a "loss of innocence".