Benjamin Best, 20, uploaded a video of the prank on Snapchat and was reported to the police, Weymouth Magistrates' Court heard.
In the clip, filmed in a Lidl in Bridport, Dorset, he licks his fingers while facing the camera.
Best, who is out shopping for his grandparents at the store, then strokes a set of napkins, which are wrapped in plastic packaging, and puts his face covering back on.
"Don't get the virus," he says, in the video uploaded on April 3.
Charles Nightingale, prosecuting, said the gross stunt took place at the height of the first lockdown when strict hygiene measures were in place.
He said: "He was wearing a mask and gloves and licked two fingers in his mouth and then preceded to swipe those fingers across paper napkins on the shelf.
"He filmed himself doing it. He uploaded the small recording to Snapchat and it was seen by 60 people.
"It came to the attention of the police and the recording was seized.
"He thought it was a joke. He thought his friends would find it funny.
"But it wasn't. Some people who saw it reported it to the police."
Mitigating, Ian Brazier said Best's actions were "stupid" but he has since been working hard and helping out his relatives.
He said: "I think that this was done at the spur of the moment for a laugh.
"He has had quite a lot of time to reflect upon it. He has been helping out at home, looking for work and worked at a carpet fitting company, something that he tried out and liked."
Mr Brazier told the court his client was described as "kind and considerate" in a letter written by his grandparents.
Best pleaded guilty and was handed an 18-month community order and told to carry out 180 hours of unpaid work.
He was also ordered to pay a £90 victim surcharge and costs of £85.
Presiding over the case, Magistrate Debbie Boitoult said: "This was a very serious incident.
"Given the rules, you committed this offence at a time of extreme stress and fear.
"You thought it would be funny to make the video.
"It was clear that people weren't laughing, hence why you are in court."