Kieron Wright, 23, said that the NHS worker looking after him at Sunderland Royal Hospital was "ape looking" and warned visitors not to bring him bananas in case she robbed them from him.
The shocking post on the social networking site was seen by the NHS trust bosses who reported it to the police.
Demolition worker Wright, of Rosedale Street, Sunderland, was arrested and admitted sending an offensive communication.
Sunderland at Wembley: London pub landlord thanks SAFC fans for ‘bumper weekend’ after League play-off final victory over Wycombe Wanderers
Sunderland AFC fans launch fundraiser as ‘thank you’ to staff at Covent Garden pub after Wembley play-off final win
Woman caught drink-driving in Sunderland Aldi car park
Sunderland to get its first roller rink in Keel Square with live DJ - here's when it opens
19 Sunderland locations hosting Queen's Platinum Jubilee street parties
Newcastle Crown Court heard the post was put on Facebook on March 10.
It read: "Been moved ward again. Now on ward B26 and I've got a big, ape-looking lass for a nurse. Not happy one bit. If any of you are thinking about popping up with fruit etc, leave the bananas in the house, I don't fancy getting robbed haha."
Prosecutor Anne Richardson told the court the "extreme language" amounted to a "racial hate crime" which caused disgust to the hospital manager who saw it.
Wright was arrested and said he had not intended to cause any offense and was sorry if he had.
Mr Recorder Stephen Morris QC told Wright: "You realise, at the time, the nurse was in fact helping you.
"That was a deeply offensive message to post on a public forum.
"I have no doubt anyone who read it would have been disgusted by what they saw.
"Such language is entirely unacceptable.
"I do not accept you didn't realise how offensive the message was but I accept you have apologised and shown remorse.
"This was not a post sent to one individual, it was widely disseminated to members of the public. It was a racially motivated offensive message committed against someone working in the public sector, nursing staff at a public hospital, which is also an aggravating feature."
A spokeswoman for the trust told the Echo that the NHS bosses 'will not hesitate' in reporting such incidents and supporting their staff members.
Wright, who has previous convictions for violence and disorder, was before the judge for the Communications Act offence and an assault by beating, which he was convicted of after a trial.
The violence related to him punching a man at his home when he went to complain about the quality of the cannabis he had bought from him.
Wright, who has been on a curfew for around eight months as part of his bail conditions, was sentenced to a community order for 18 months with rehabilitation and supervision requirements.
Alec Burns, defending said: "He is very sorry for having done this and very sorry she had to read what he had written.
"He did not see it at the time but she was helping him.
"He apologises and apologised very shortly afterwards."
Mr Burns said Wright has now got a demolition job and is willing to work hard and stay out of trouble.
A spokeswoman for City Hospitals Sunderland NHS Foundation Trust said: "The NHS is a very diverse workforce and it is unacceptable for any member of our staff to be the subject of racial comments on social media whilst caring for patients.
"The Trust takes all forms of abuse very seriously, whether that be verbal, racial or violent, and we will not hesitate to support our staff by reporting such incidents."