Kan-Hua Ren, known as ReSet, was found guilty of an offence against moral integrity in his video published in January 2017 on his channel and since removed, the Barcelona court said.
He was sentenced to 15 months in jail, which he won't likely have to serve.
Sentences of up to two years are generally not implemented in Spain for first-time offenders in non-violent crimes.
Ren was also ordered to pay 20,000 euros in compensation to the victim and his channels will be closed down for five years.
“Challenged” by one of his followers, Ren, who was 19 at the time, filmed himself removing cream from inside biscuits and replacing it with toothpaste.
Then he gave them to a Romanian beggar along with a 20-euro bill.
“Maybe I went a little far, but let's look at the positive side, it will help him clean his teeth, I don't think he has often brushed his teeth since he became poor,” Ren told his followers, according to a court document.
The homeless man threw up, wrote the judge in her verdict dated May 29.
The video sparked an outcry, so Ren posted a new one in which he went back to see the man and gave him another 20 euros.
“If I had done this with a normal person, no-one would have said a thing, but as he is a beggar people are complaining,” he said in a message accompanying the video, according to the court document.
Among the 200 most influential Spanish-speaking personalities on YouTube at the time, police said he then tried to stop the victim making a complaint in exchange for 300 euros and yet another video in which he would spend the night with him.
Police added he targeted other vulnerable people in other videos on his channel, where he earned money through advertising.
“I do things for showmanship, people like anything morbid,” he told the court.
On Friday, Ren's two YouTube channels, which respectively have more than 1.2 million and 250,000 followers, were still online.