The laws vary by state, I think. California, for example, AUTOMATICALLY puts the Greens and Libertarians on the ballot, regardless of their performance...it is in the State Constitution (or at least state law). Pretty crappy stuff.
I don’t think such law would hold up to constitutional challenge.
When specific parties (but not ALL parties) are identified in a law for preferential treatment on the ballot, it would appear to game the system.