Parties are not at all illegal, under the Constitution.
Parties simply must abide by the State and Federal election laws.
I did not say parties are illegal, only that they have no role in the Constitutional process, which is quite accurate.