"But in terms of actors, I think you're a better actor the less people know about you, period," he continued. "And sexuality is a huge part of that. Whether you're straight or gay, people shouldn't know anything about your sexuality because that's one of the mysteries that you should be able to play."
Damon, who has four children with wife Luciana Barroso, said he was uncomfortable when rumors were spread years ago that he and Good Will Hunting co-writer Ben Affleck might be in a gay relationship together.
Photos of Matt Damon from over the years:
Matt Damon suggests gay actors should stay in the closet
HOLLYWOOD, CA - NOVEMBER 07: Actor Matt Damon attends the 'Project Greenlight' event at Boulevard3 on November 7, 2014 in Hollywood, California. (Photo by Jason LaVeris/FilmMagic)
Matt Damon, second from left, in "Good Will Hunting."
Matt Damon with Gretchen Mol in "Rounders."
Matt Damon with Minnie Driver in "Good Will Hunting."
Matt Damon in "The Talented Mr. Ripley."
Matt Damon in "The Informant."
Matt Damon in "The Informant."
Morgan Freeman with Matt Damon in "Invictus."
HOLLYWOOD, CA - NOVEMBER 07: Actors Matt Damon and Ben Affleck attend the 'Project Greenlight' event at Boulevard3 on November 7, 2014 in Hollywood, California. (Photo by Jason LaVeris/FilmMagic)
LOS ANGELES, CA - OCTOBER 08: Matt Damon and Luciana Barroso with his mother Nancy Carlsson-Paige are seen on October 08, 2014 in Los Angeles, California. (Photo by Bauer-Griffin/GC Images)
LOS ANGELES, CA - SEPTEMBER 29: Matt Damon seen at LAX on September 29, 2014 in Los Angeles, California. (Photo by GVK/Bauer-Griffin/GC Images)
VENICE, ITALY - SEPTEMBER 29: (L-R) Matt Damon and Luciana Barroso sighting at Marco Polo Airport on September 29, 2014 in Venice, Italy. (Photo by Ernesto Ruscio/GC Images)
US actor Matt Damon boards a taxi boat at the Cipriani hotel on September 27, 2014 in Venice where US actor George Clooney and British fiancee, Amal Alamuddin celebrate their wedding. George Clooney has said goodbye to bachelorhood in Venice with a stag party at his favourite restaurant with Hollywood chums, and was gearing up for a day of glamourous pre-wedding celebrations. The actor had swept into the floating city yesterday with his British fiancee Amal Alamuddin on a watertaxi dubbed 'Amore', zipping up the Grand Canal to cheers from fans at the start of nuptials set to draw out over the weekend. AFP PHOTO / ANDREAS SOLARO (Photo credit should read ANDREAS SOLARO/AFP/Getty Images)
NEW YORK, NY - SEPTEMBER 23: Actor and co-founder of Water.org Matt Damon speaks at the Clinton Global Initiative (CGI), on September 23, 2014 in New York City. The annual meeting, established in 2005 by President Clinton, convenes global leaders to discuss solutions to world problems. (Photo by John Moore/Getty Images)
LOS ANGELES, CA - JUNE 27: Matt Damon is seen in Los Angeles on June 27, 2014 in Los Angeles, California. (Photo by Pixplus/Bauer-Griffin/GC Images)
BOSTON, MA - JUNE 10: Matt Damon is seen at Boston Logan airport on June 10, 2014 in Boston, Massachusetts. (Photo by Stickman/Bauer-Griffin/GC Images)
BOSTON, MA - JUNE 10: Actor Matt Damon attends the Mass General Hospital Cancer Center's 7th annual 'the one hundred' Event at the Westin Boston Waterfront Hotel on June 10, 2014 in Boston, Massachusetts. (Photo by Paul Marotta/Getty Images)
LOS ANGELES, CA - MAY 15: Matt Damon attends an NBA playoff game between the Oklahoma City Thunder and the Los Angeles Clippers at Staples Center on May 15, 2014 in Los Angeles, California. (Photo by Noel Vasquez/GC Images)
LOS ANGELES, CA - MARCH 06: Matt Damon is seen leaving Katsuya restaurant on March 06, 2014 in Los Angeles, California. (Photo by Bauer-Griffin/GC Images)
PARIS, FRANCE - FEBRUARY 12: Actor Matt Damon and his wife Lucinda Damon attend the 'Monuments Men' : Premiere at Cinema UGC Normandie on February 12, 2014 in Paris, France. (Photo by Bertrand Rindoff Petroff/Getty Images)
PARIS, FRANCE - FEBRUARY 12: Matt Damon attends 'Monuments Men' Paris premiere at Cinema UGC Normandie on February 12, 2014 in Paris, France. (Photo by Julien M. Hekimian/Getty Images)
MILAN, ITALY - FEBRUARY 09: L-R Fabio Fazio, George Clooney and Matt Damon attend 'Che Tempo Che Fa' TV Show on February 9, 2014 in Milan, Italy. (Photo by Stefania D'Alessandro/Getty Images)
MILAN, ITALY - FEBRUARY 09: Matt Damon attends 'Che Tempo Che Fa' TV Show on February 9, 2014 in Milan, Italy. (Photo by Stefania D'Alessandro/Getty Images)
BERLIN, GERMANY - FEBRUARY 08: Actor Matt Damon and Luciana Barroso attend 'The Monuments Men' premiere during 64th Berlinale International Film Festival at Berlinale Palast on February 8, 2014 in Berlin, Germany. (Photo by Anita Bugge/WireImage)
BERLIN, GERMANY - FEBRUARY 08: Matt Damon attends 'The Monuments Men' press conference during 64th Berlinale International Film Festival at Grand Hyatt Hotel on February 8, 2014 in Berlin, Germany. (Photo by Luca Teuchmann/Getty Images)
Discover More Like This
BACK TO SLIDE
"It's just like any piece of gossip...and it put us in a weird position of having to answer, you know what I mean?" Damon said. "Which was then really deeply offensive. I don't want to, like [imply] it's some sort of disease -- then it's like I'm throwing my friends under the bus."
"But at the time, I remember thinking and saying, Rupert Everett was openly gay, and this guy -- more handsome than anybody, a classically trained actor -- it's tough to make the argument that he didn't take a hit for being out," the Martian actor added.
Damon explained the comments during Monday's episode of The Ellen DeGeneres Show, saying that his remarks were made "in the context of when Ben [Affleck] and I first started, and people wrote all these articles, when Good Will Hunting came out, that we were gay because it was two guys who wrote the script."
"I was just trying to say actors are more effective when they're a mystery," he told Ellen DeGeneres. "And somebody picked it up and said I said gay actors should get back in the closet. (Laughs.) I mean, it's stupid, but it is painful when things get said that you don't believe, and then it gets represented that that's what you believe."
Earlier this month, Damon apologized for comments he made on Project Greenlight regarding diversity behind the camera. "When we're talking about diversity, you do it in the casting of the film, not in the casting of the show," Damon said on an episode of the HBO unscripted series.
The question of an A-list actor's sexuality made headlines recently when Tom Hardy took a reporter to task during a Legend press conference at the Toronto Film Festival after the reporter asked about his sexual orientation.
Damon's rep didn't immediately respond to a request for comment.