Fundamentally, political parties are based on freedom of association.
Freedom of association allows people to form their own groups, for whatever reason. A group of hikers, model railroad enthusiasts, or a group seeking political ends.
Political parties also cross into advocacy, which is/can be petitioning government for redress. Another constitutionally protected thing.
Best option that I can see is having elections ignore party affiliation. Basically the jungle primary thing.
But in my experience, with nonpartisan elections, everybody still knows what ‘party’ the candidates are.