Miles Morales, the new alter ego for Spiderman, will get a sleek new black outfit with a deep red spider on the chest and cobwebs on the shoulders and head. (ASSOCIATED PRESS)

When Peter Parker died last June in a fight with the Green Goblin, Marvel Comics needed a scrawny American teenager who fights crime and slings spider webs to replace him.

Instead of finding the typical Caucasian hero for the “Ultimate Spider Man” series, Marvel instead went with Miles Morales, a character of black and Latino descent.

Marvel says the idea for a multi-ethnic spiderman has been in the works for a while. But some of the credit needs to go to black actor Donald Glover, who last summer lobbied to audition for the starring role in “The Amazing Spider-Man.”

While Glover did not get the role, his lobbying sparked many a discussion about race, racial casting and whether or not Peter is indeed white. On Twitter, Glover’s name became a trending term.

“Ultimate Spider-Man” writer Brian Michael Bendis says that Glover’s actions convinced him he was making the right move in choosing Miles Morales.

Arguments about racial casting in big-budget films have been going on for years. One of the most memorable came in March 2010, when casting decisions for M. Night Shyamalan’s “The Last Airbender” were called into question after the animated series chose all white actors for the three main Asian roles of Aang, Katara and Sokka. 

Shyamalan argued that some of the characters were actually Inuit and that race was not a factor in deciding who was cast. He also went so far as to call “Airbender” the “most culturally diverse tent-pole movie ever made.”

Axel Alonso, Marvel's editor-in-chief, recently said that “the company prides itself ... on reflecting the real world in all its diversity.”

But Marvel has made mistakes before. In June, Atlantic writer Ta-Nehisi Coates wrote a passionate article in the New York Times in which he took issue with the fact that new “X-Men: First Class” film set in the 1960s didn’t refer to the civil-right struggles of that time period at all. Coates called the film an “insidious suspension of disbelief,” writing:

Here is a period piece for our postracial times — in the era of Ella Baker and the Rev. Dr. Martin Luther King Jr., the most powerful adversaries of spectacular apartheid are a team of enlightened white dudes.

In July, the summer of superheroes continued with Marvel’s “Captain America,” and the flick got similar criticism for pretending segregation didn’t exist in the 1940s. Adam Serwer of American Prospect wrote:

White and black soldiers are shown serving together without incident, erasing one of the moral complexities of World War II — that American service members defeated a murderous racist dictator even as America was upholding a system of racial apartheid at home.

UPDATE, 4:23 p.m.

While Marvel has had diverse characters in its comic books for years (In 2009, The Post’s Comic Riffs blog wrote a post summing up the best black comic book characters), the arrival of Miles Morales has not been well-received.

On his radio show today, Glenn Beck called Spiderman a “stupid comic book,” and then said that he attributes the new biracial Spiderman to Michelle Obama.

“I think a lot of this stuff is being done intentionally. What was it that Mrs. Obama said before the campaign? Because it’s strange how so much of this seems to all be happening,” Beck said. He then played an audio file in which Michelle Obama says “we’re gonna have to change our... traditions.”

Beck wasn’t the only one. Jim Treacher, a columnist at the Daily Caller, tweeted the following sentence before getting a flurry of angry tweets:

I think it’s great that the new Spider-Man is black. I just hope he doesn’t blame all his problems on Peter Parker.less than a minute ago via web Favorite Retweet Reply’Jim’ ‘Treacher’

Meanwhile, the New England comic book store chain Larry’s comics responded to the news by making racist Spider-man jokes, writing: “Q: Hey Spidey, why you web slinging so fast? A: KFC closin’ in a few minutes.” The owner took the jokes down after angry customers told him off on Twitter.

A USA Today story on the new Spider-man saw similarly offensive statements in its comments section. One commenter wrote: “Peter Parker could not be whiter. A black boy under the mask just don’t look right. This opens up a whole new story line with a whole new set of problems. Who is going to believe a black man in a mask is out for the good of man kind?”

Cynthia Wright at the Atlanta Post says the backlash to the new Spider-man shows only one thing: We are not the post-racial society we think we are.

UPDATE, Sept. 15, 2011

Treacher said that his joke was not meant as a criticism of the new Spider-man, but of Obama.

“I [took] the opportunity to make a joke comparing the first black Spider-Man to the first black president, who has a habit of blaming his problems on his predecessor,” Treacher said in an email.

More on Treacher’s thoughts on the new Spider-man here.