Can "to spill" be used with small fragments such as crumbs?
The main requirement for spilling something is not that it be liquid, but that it first be in a container of some kind. A banana yogurt can spill in your backpack because it's in a container; a banana can't — the peel doesn't count as a container. If you eat crackers in bed, you drop crumbs or get crumbs all over the place, but you don't spill them unless you've first caught them, say, in a saucer.
A truck is also a container from which virtually anything can spill out because of a traffic accident: 40,000 pounds of avocados, thousands of eels, or a thousand books.
I don't much like "spill" in the banana example. I would not see that as idiomatic. However it would be perfectly possible to spill a bagful of bananas - but it would mean that the bananas actually came out of the bag and fell on the floor.
One can "spill" almost anything, but it is usually multiple items that fall out of their container. Having said that sometimes a player attempting to catch a ball in rugby, or in cricket will "spill the ball". It means they get their hands on it but cannot hold it.
"Spill" is also used metaphorically for things like "a story", "ideas" etc. It simply means to speak up and reveal something.
i wouldn’t necessarily say something spilled must be in a container. The items must be gathered together and contained or held back in some fashion, and then spilled out. I can spill crumbs on the floor while carrying them in my hand; I can spill out my secrets after holding them back. But to your question, “Does spill apply to liquids only?”, absolutely not.