Ive never seen mold grow on ketchup or leftover meat(nothing added to it). When exposed to moisture spinach will get mold faster than almost anything that i know of. I think it depends on the food item and how it can harbor moisture which can promote mold. Also depends on the preservatives and acids in the food as well. Bread harbors moisture very well gets moldy fast. Oils can sit on the shelves for months and never get moldy. Sugar water can sit in the fridge and not get moldy. Carrot juice which is very alkaline has to be used up very quickly. It just seems the more alkaline the substance is the faster it gets moldy/goes bad.
You are right, moisture is the biggest factor, not sugar content. Look at wallboard after a flood. It can get very moldy not from sugar content but from presence of moisture. Sugar content is secondary as the moisture is required to get the growth going.
Also, people should keep in mind that the practice of culturing food was started to preserve the food as the acids control the growth of molds, fungi, and other pathogens.