Stacey, 21, of Pontypridd, south Wales, sobbed as he was taken away following the failed sentence appeal hearing at Swansea Crown Court.
Mr Justice Wyn Williams told him he rejected an argument that Stacey had already been punished enough.
He said the Swansea University biology student had admitted an offence, racially aggravated public disorder, of intent.
''He was intending to say what he said and was intending to produce the effect that he did.''
Stacey, 21, provoked revulsion with comments made while the Bolton Wanderers star still lay on the pitch.
Student jailed for 56 days over Muamba tweet
27 Mar 2012
The 23-year-old midfielder was left fighting for his life after suffering a heart attack during an FA Cup tie on March 17.
Horrified fans watched live on TV as he fell to the ground during the quarter-final clash at Tottenham Hotspur.
Police were inundated with complaints as members of the public reported the student's comments.
Stacey, a Swansea University biology undergraduate, was quickly tracked down and arrested.
He admitted inciting racial hatred and was was jailed for 56 days at Swansea Crown Court.
The first of Stacey's messages began with ''LOL (laugh out loud). **** Muamba. He's dead!!!''
A number of people took him to task for his views and he responded with a further string of offensive comments aimed at other Twitter users.
He heard the appeal today with two magistrates from the court where the original sentence was imposed last Tuesday.
After listening to arguments from both sides, he adjourned for 30 minutes to reach a conclusion.
He returned more than 90 minutes later and immediately apologised for the delay.
"You will all understand that this is a very emotive and very difficult case and we wanted to be sure in our minds that what we were doing was right," he said.
He went on to highlight a penalty notice that Stacey received in March last year for violent disorder.
The incident had previously been overlooked and was not mentioned at Stacey's earlier sentencing.
It was triggered by a drunken Stacey becoming violent as he was ejected from a pub, which caused the police to be called.
He went on to threaten and swear at the officers who arrived on the scene and was eventually arrested for a public order offence.
Earlier Paul Hobson, for Stacey, who had been unaware of the offence, set out why the student should be freed.
He spoke of the effect that the case had already had on his family and friends and argued that a suspended sentence or a community order would be appropriate.
"What he did on that particular night was vile," he began.
"But I would submit that the court can conclude that, vile though his actions were, he is not a vile person.
"What he did does not define his whole personality, but it will be a blot on his character forever."
He added: "Very rarely will a court deal with an individual who has attracted so much stigma."
He said the stigma had affected his family and friends, who were guilty of nothing.
A fortnight ago Stacey was a "normal student at the local university. Unknown to anyone outside family and friends".
"In short, he had a very bright future in prospect," he said.
In contrast, now he has a criminal conviction and his academic future is "in the air" with a university disciplinary hearing next month.
"He is now three days into a prison sentence and, probably worse than all of that, he has managed to achieve a notoriety and perhaps pariah status."