I just found this enlightening bit of info on the wiki:
A lot of people find the Food Replicator confusing, saying that the food randomly spoils. After extensive research, the reason for this has been found - the replicated food is directly linked to the quality of the original, or, to be more exact, the quality of the fridge. Basically, when the food in the fridge goes bad, so does the food in the replicator. For that reason, it is HIGHLY RECOMMENDED that a Sim complete the Culinary Career. This grants the Sim a special refrigerator that causes food to never spoil. By proxy, this will result in food never spoiling in the replicator.