the reason is probably because off foil it is exposed to more direct and higher heat levels, where as mixed in weed the heat is lower. you say you haven't smoked crack before, and thats probably why it worked for you. if you were going into this experience having smoked crack in the past then I think the effects would have been much less noticeable. its cool if you enjoyed it, but I think you'll agree that its more of something to try once and then never do again (unlike it's cracky cousin).
because I dont think it has been explained thoroughly enough in this thread I think I'll go into a little mini science lesson for those interested. the reason why this wont work, as it's been stated earlier, is because hcl molecules burn at a lower temp. this is true for all the drugs I can think of, it's the reason why heroin base in the uk aka #3 smokes better than #4 and needs an acid to be dissolved and injected (just like crack). anyways so the process of turning a hydrochloride or salt form of a drug into a base raises the temperature at which that compound burns. when you smoke down crack you dont want it to burn, you want it to vaporize because burning causes the molecules to break down and degrade. so when cocaine hcl is turned into a base the melting point is lowered and the temp at which it burns/degrades is higher making it easier to smoke. when you smoke powder (or attempt to vaporize), depending on your method you will be burning a lot of the compound meaning you'll inhale god knows what and you will only vaporize a small amount of the total drug you are trying to smoke. some compounds, notably cannabanoids, can be smoked in their hcl form due to the propertys of the molecule, but in general attempting to vaporize creates better results. another notable exception is crystal meth, this chemical vaporizes fine in it's hcl form, and because meth base is a viscious oily liquid no one bothers trying to free base it. apvp and mdpv are some other ones I wont go into detail about because I'm not experienced with them