Any way to have windows be restored to the correct space when opening an app? Every time I open an app and it restores the windows that it has open, they generally restore to whichever space is currently active, rather than to the space the windows were originally on before I quit the app. For example, if I have several terminal windows open on different spaces, quit Terminal.app and relaunch it, then the terminal windows all reopen, but do so on the current space. TextEdit, Xcode, iTunes, Messages, all of the apps I use have this problem. The only one that reopens its windows to the correct space is Finder.

This is annoying, because it means that every time I reboot my computer I have reorganize all of my spaces again. And I have lots of windows open, and they're all organized across six different spaces. It's getting tedious.

Is there a trick, hack, or something I can use to fix this?
It's unclear from your question whether you have done the obvious so I will mention it just in case.
When looking at a specific space, right click (option click) on the icon (in the dock) of the app you want to "pin" to the specific space . There will be two options shown that say something like "this space" or "any space" (I'm sorry, I'm not on my Mac so I can't be more precise, but I think you will be able to understand this method)