If what you say about it being private, there need never be a law.
A law makes it a public issue.
It needs the law because the political parties got the government (taxpayer) to run/pay for the voting for the private parties.
Why do you think the DNC just willy nilly changes the rules about whom can run for president on behalf of the DNC and pushed the GOP to do the same to prevent Trump getting the nomination.