"Spill" is also used for solid foods. In some circumstances, "drop" seems to be a better choice. For example:
Oops! I dropped my hamburger.
Dude, why are you so clumsy? You spilled all your food on my notebook.
From Cambridge Dictionary
Spill: to (cause to) flow, move, fall, or spread over the edge or outside the limits of something:
I spilled coffee on my silk shirt.
You've spilled something down your tie.
Let's see if I can pour the juice into the glass without spilling it.
He dropped a bag of sugar and it spilled all over the floor.
Crowds of fans spilled onto the field at the end of the game.
From thefreedictionary:
To cause or allow (a substance) to run or fall out of a container.
You can also say:
Be careful, don't spill your food.