That is still unsanitary no matter if you are wearing gloves or not, because you are still touching the money then going and preparing someone’s food so all of the germs that was on the money, just transferred into the food. Now if you were handling money with your bare hands THEN you put on the gloves to prepare the food, that would be sanitary because the germs would be under the glove.
I hope this helped! :-)