Why doesn't the red dot shut down the program?
Great question. This was one of my first confusions about the Finder when switching to Mac. Here's what I think: 

On other operating systems, the program menu is contained in the active application window. As such, each window is in essence a full instance of the program. (There's not as much integration with Windows Explorer, as there is with Finder on Mac OS. It' a tiny difference, but it really alters user experience.(My proof is the fact that you're asking this question.)

By contrast, on Mac OS X, the menu bar in the Finder is where all Apps' menus go. All running programs are tied to the Finder in a different way than on other operating systems. On Mac, a program may have auxiliary windows and such. In other operating systems, you generally have similar "panels" in their own window.

Also, remember that the yellow and green buttons only effect the window that they're in, so it seems odd to group a control that effects the entire app with two that only effect one window. Therefore, the "red dot" only affects the active window. 

One notable exception is the Mac App Store. In that case, you are one hundred percent correct. Clicking the red dot closes the entire app. Notice how the App Store has no auxiliary menus or panes? Closing that Window does indeed mean you're exiting the app.