"For all intents and purposes" is the correct phrase according to American usage. The British version of the idiom is "To all intents and purposes." (See the Related link.)
Neither of the phrases in the question is correct. The correct wording, in American English, is "for all intents and purposes." In British English, however, the wording of the selfsame idiom is "to...
The correct phrase is "to all intents and purposes." This phrase dates back to the 1500s and originated in English law, where it was "to all intents, constructions, and purposes." In modern usage,...