I, too have a theory about why it seems that you get good ideas while you're stoned. In David Sedaris' book Me Talk Pretty One Day, there is a story from when he was in college. Though it involves a different drug, I argue it applies here. He starts taking lots of crystal meth, and starts to fancy himself a conceptual artist. He and his friends believe that everything they say and do is brilliant! Brilliant! He and his friends compose bizarre, silly conceptual art. I believe this is because the methamphetamine disconnects or distorts the part of his brain responsible for judging aesthetics. In the end, as Sedaris makes painfully clear, he was never a genius simply because he took drugs. The drugs just blocked his ability to accurately perceive himself.

I believe that when you're stoned, it's pretty similar. Perhaps the whole reason people take drugs, and get stoned in particular, is to break down mental barriers. Some mental barriers are purely artifice, imposed by society or by habitual "ruts" of thinking. Some barriers are basic logical barriers, such as the barrier that keeps you from trying to fly, for example. When a person evaluates an idea's quality, they try to find barriers that make the idea invalid. If all the barriers no longer exist because THC has squelched them, then nothing stops the mind from determining the idea is good. Thus, many ideas which are very stupid when sober "seem like a good idea at the time."

On the other hand, weed changes the operation of short-term memory, causing linear trains of thought to dissolve. Many more unrelated ideas can slide into the thought process, a fun and definitely exhilarating barrage of randomness. The brain attempts to interpret these new, disconnected ideas without its usual barriers in place to bring it down to earth. So a large proportion of ideas seem clever at the time, and oftentimes your brain will succeed in remembering a general "I had a lot of ideas which were good (did not hit barriers)" afterwards, but not really remember the specifics.

In terms of creativity, though, much of the very idea of "creative" is simply breaking out of the normal patterns of thought and "ruts". With weed, for some people, they can find new and interesting ideas, obtained after the ruts have been broken down.