Since both your sentences deal with food, the definition and usage of each word in question should be clear after a quick check with your dictionary. Spoiled means that the food has become unfit for human consumption. Rotten means suffering from decay leading to decomposition.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.