"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.

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)

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)

"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.