For the punctuation marks for which you are asking the question (comma, colon, question mark, and exclamation point), they are written without any space before them, and with a space after them.
This is what you need: canned tuna fish, tomatoes, beans, olive oil, onions, parsley, and garlic.
I cannot believe it! You are accusing me of something you did!
What time is it? I am hungry.
The same is true for the semicolon and the period.
As for what's wrong with the wrong way, it is just not how punctuation marks are used nowadays. If you put a space before the exclamation point, I would think you are French, and that you are writing in English using the punctuation marks as you would in French, since in French you normally write a space before the exclamation point or the question mark.
Before I answer your question, I should mention that the sentence structure you're using here ( These things, they were _____ .) is pretty common in East Asian languages (Chinese, Japanese and Korean). In English, however, it's not -- and I'm not sure that it's grammatically correct, to be honest. Mind you, I'm not sure that it's incorrect either, but it is definitely not in regular usage.
In English, we drop the "he/she/it/they/you" that follows the comma in question -- and in turn, drop the comma, too. So--
The movies I saw last week, they were science-fiction, thrillers and war movies.
This becomes:
The movies I saw last week were science-fiction, thrillers, and war movies.
Likewise, for your second example--
The courses I took at Y university, they were course1, course2 etc.
This becomes:
The courses I took at Y university were course1, course2 etc.
That's how you'd go about writing those out properly. If these sentences were spoken, it wouldn't be unheard of (ha, pun!) to hear a sentence like that, but that's because the pause following "week" and "university" (the comma) could just as easily be pauses as the speaker thinks for a moment to recall WHICH movies they had seen, and WHICH courses they had taken. By the time they finished recalling the movies/courses, they might decide that it would make more sense to use "they" instead of mentioning the subject again, to save time.
Best Answer
According to The Chicago Manual of Style†, section 14.21, this is the normal way to do it:
In my experience (which is mostly from reading linguistics papers), this is the usual practice. I decided to check my memory, so I opened ten papers at random on my hard drive by different authors. I found that nine followed this practice, while the remaining paper placed the superscript reference number before any punctuation. So it seems (at least from a sample of linguistics papers) that this practice isn't followed universally, but I'd nonetheless recommend you follow common practice both for aesthetic reasons and to avoid distracting the reader.
† Thanks to Jason Patterson for pointing this out in the comments section.