And "rightly so," he said in an interview with The New York Times Magazine, published Wednesday.
"Could a straight man do what I did in ‘Philadelphia’ now? No, and rightly so," he said. "The whole point of 'Philadelphia' was don’t be afraid. One of the reasons people weren’t afraid of that movie is that I was playing a gay man."
Hanks added that "we’re beyond that now."
"I don’t think people would accept the inauthenticity of a straight guy playing a gay guy," he continued. "It’s not a crime, it’s not boohoo, that someone would say we are going to demand more of a movie in the modern realm of authenticity. Do I sound like I’m preaching? I don’t mean to."
Hanks earned his first best actor Oscar for his performance in "Philadelphia" as Andrew Beckett, a gay attorney diagnosed with AIDS and battling workplace discrimination. Hanks took home his second best actor Oscar a year later for playing the title role in 1994's "Forrest Gump."
In his "Philadelphia" acceptance speech, Hanks said his work in the film "is magnified by the fact that the streets of heaven are too crowded with angels."