Can government cancel a primary?

Can government cancel a primary?
The simple answer is yes, but that doesn't mean they should?
Some background.
There is no provision in the constitution for political parties, that's why the DNC and RNC are private companies. Remember when Florida Rep. Debbie Wasserman Schultz pretty much got busted rigging the primary against Sanders? Know why she didn't go to jail for election tampering? Because the primary is not part of the constitution.
Each state has their own primary rules and the logistics of those rules are handled by the Board of Elections, a government agency. Kind of like taking a flight, the airlines are private but the logistics are run by government. NY just canceled the primaries due to Covid. We've established they could legally now lets examine why they shouldn't.
Why canceling a primary is a bad Idea
I like to talk about precedent. Precedent is a power thing, this country has had presidential primaries for 100 years, that's established precedent. Take away the primaries and states lose thier voice to private corporations. In NYs current case some may say well Sanders has conceded so. That doesn't mean people can't still vote for him. History has shown us people have won elections based on write in ballots:
Herbert Hoover won the 1928 Republican presidential primary in Massachusetts on write-ins, polling 100,279.

Franklin D. Roosevelt won the 1940 Democratic presidential primary in New Jersey with 34,278 write-ins.

Thomas Dewey won the 1944 Republican presidential primary in Pennsylvania with 146,706 write-ins.

Harold Stassen won the 1948 Republican presidential primary in Pennsylvania with 81,242 write-ins.

Robert A. Taft won the 1952 Republican presidential primary in Nebraska with 79,357 write-ins, Estes Kefauver won the 1952

Democratic presidential primary in Pennsylvania with 93,160 write-ins and Dwight Eisenhower won the 1952 Republican presidential primary in Massachusetts with 254,898 write-ins.

Dwight Eisenhower won the 1956 Republican presidential primary in Massachusetts with 51,951 write-ins.

Richard Nixon won the 1960 Republican presidential primary in Massachusetts with 53,164 write-ins

John F. Kennedy won the Democratic Pennsylvania presidential primary with 183,073 write-ins along with the Democratic Massachusetts presidential primary with 91,607 write-ins.

Why did they cancel it?
Officials said the election was canceled due to fears of spreading Covid. The same government that said go out and get a job as an essential worker. The same government that said you can wait on food pantry lines for hours. The same government that said you can line up outside of Lowes to buy a light bulb. But you can't line up to vote, think about that.