"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)
Actors Ben Affleck, 25, left, and Matt Damon, 27, pose during an interview in New York Nov. 22, 1997. The two friends from high school days in Cambridge, Mass. wrote and star in the movie, "Good Will Hunting." (AP Photo/Yukio Gion)
Matt Damon, right, and Ben Affleck hold their Best Screenplay for a Motion Picture award at the 55th Annual Golden Globe Awards in Beverly Hills, Calif., Sunday, Jan. 18, 1998. Damon and Affleck won for the film "Good Will Hunting." (AP Photo/Mark J. Terrill)
Cast members of the new Gus Van Sant film, "Good Will Hunting" Ben Affleck, left, Minnie Driver and Matt Damon arrive at the premiere of the movie Tuesday, Dec. 2, 1997, in Los Angeles. The movie also stars Robin Williams. (AP Photo/John Hayes)
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."
Actors Matt Damon, left, and Brad Pitt talk arrive for a photocall to promote their latest movie "Ocean's Twelve" in Rome's Capitol Hill, Friday, Dec. 10, 2004. (AP Photo/Gregorio Borgia)
Morgan Freeman with Matt Damon in "Invictus."
A rare moment in which Baldwin isn't breaking the tension. (AP Photo/HO/Courtesy of Warner Bros. Pictures/Andrew Cooper)
Australian actor Heath Ledger, left, and US actor Matt Damon pose for photographers after a press conference to present their latest movie "The Brothers Grimm" by US director Terry Gilliam at the 62nd edition of the Venice Film Festival in Venice's Lido, northern Italy, Sunday, Sept. 4, 2005. (AP Photo/Domenico Stinellis)
Actor Matt Damon and his nephew, Jack Damon, watch the game between the Pittsburgh Pirates and the Boston Red Sox at Fenway Park in Boston, Sunday, June 19, 2005. (AP Photo/Michael Dwyer)
Hollywood star Matt Damon laughs at a news conference to promote one of his latest movies "The Bourne Supremacy" at a Tokyo hotel Wednesday, Jan. 12, 2005. The new film, a sequel to Damon's hit movie "The Bourne Identity," about amnesiac assassin Jason Bourne, will be released Feb. 11 in Japan. (AP Photo/Katsumi Kasahara)
Ben Affleck, right, and Matt Damon pose for photos on the red carpet prior to the world premiere of "Feast" at the Palms Casino & Hotel in Las Vegas on Tuesday, Sept. 12, 2006. Affleck and Damon are executive producers of the film which was made possible by the duo's television show "Project Greenlight". (AP Photo/Isaac Brekken)
Die US-Schauspieler Matt Damon am Samstag, 10. Feb. 2007, in Berlin waehrend einer Pressekonferenz zu seinem Film "Der Gute Hirte" bei den 57. Berliner Filmfestspielen "Berlinale". (AP Photo/Markus Schreiber) --- US actor Matt Damon attends a news conference for his movie "The Good Shepherd" at the 57th Film Festival "Berlinale" in Berlin, Germany, Saturday, Feb. 10, 2007. (AP Photo/Markus Schreiber)
American actress Ellen Barkin, left, and American actor Matt Damon talk during a photo call for the film "Ocean's Thirteen," at the 60th International film festival in Cannes, southern France, on Thursday, May 24, 2007. (AP Photo/Jeff Christensen)
From right, American actors, George Clooney, Brad Pitt and Matt Damon arrive for the screening of the film "Ocean's Thirteen," at the 60th International film festival in Cannes, southern France, on Thursday, May 24, 2007. (AP Photo/Francois Mori)
Actor Matt Damon at the Ocean's Thirteen Premiere in Los Angeles, Calif. on Tuesday, June 5, 2007. (AP Photo/Dan Steinberg)
Actor Matt Damon is seen before being honored with a star on the Hollywood Walk of Fame in Los Angeles, Wednesday, July 25, 2007. (AP Photo/Damian Dovarganes)
Actor Matt Damon is honored with a star on the Hollywood Walk of Fame in Los Angeles, Wednesday, July 25, 2007. At left is Honorary Mayor of Hollywood Johnny Grant. (AP Photo/Damian Dovarganes)
Actor Matt Damon arrives at the premiere of "The Bourne Ultimatum" in Los Angeles, Wednesday, July 25, 2007. (AP Photo/Mark J. Terrill)
U.S. actor Matt Damon and his wife Luciana arrive for the screening of his movie " The Bourne Ultimatum" at the 33rd American Film Festival in Deauville, Normandy, France, Saturday Sept. 1, 2007. (AP Photo/Michel Spingler)
U.S. actor Matt Damon waves as he arrives for the Australian premier of his movie, "The Bourne Ultimatum", at a Sydney theater Tuesday, Aug. 7, 2007. (AP Photo/Rick Rycroft)
Matt Damon attends a presentation of "Running The Sahara" during the Toronto International Film Festival in Toronto, Saturday, Sept. 8, 2007. (AP Photo/Carolyn Kaster)
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.