Why doesn't the red dot shut down the program? If I use the red dot in the upper left of the last window of a program, why doesn't it shut the program down?

Except for rare programs that run without windows, what's the point of keeping programs running after all their windows are shut?
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.