Yes, states are responsible for administering elections in this country, pursuant to the law and guidelines.
in most cases "write in" votes (at least here in Washington) require a candidate have declared themselves a candidate, and usually that applies to people who file for office after the ballot deadline.
If the county has already printed 10,000 ballots it is not practical to recall, destroy, and re issue them. in some cases too write in candidates can avoid filing fees.
also in Washington, each county is required to have a canvassing board, which in my county is the commissioner, the prosecutor, and the Auditor who must scrutinize all write in ballots to ascertain the intent of the voter, so far from a joke, it actually slows down the process of counting ballots to file junk write-ins.