Why do some icon themes have so many different sizes?
Software often makes use of different icons thus it needs icons to be in different sizes. The difference in sizes can be attributed to the context within the software they're used, for example: Icons for the toolbars don't need to be at 512x512 whereas icons in a dock or menu need to be at a higher size.
Also, icons need to be scaled properly so they don't lose their meaning.
So artists make use of the different sizes for this. An icon created in 512x512 will look good at 100% scaling and probably at 50% but at 12.5% (64x64) the same icon will look bad, details will be lost, it may look like something completely different, etc; so another icon specifically made for that size needs to be created.
Looking around I found that Gnome has a specification for the sizes:

I'd add to this that this is specifically for Gnome icons (mostly in SVG) and maybe the Tango and Tango-based icons though the table looks quite dated as Gnome includes icons larger than that nowadays and doesn't mention symbolic icons.
So depending on the artist these may be very well vary.
I generally group icons in the following sizes (size of the canvas) according to the context in which they will be used:
Mimetypes (small-medium), Docks, Categorized Menus (Unity's Dash, Gnome Shell's application overview, System preferences), Desktop.