One thing that is worth noting is that a lot of these bizarre elected positions are county offices. States have their own government and towns/cities have their own government and then you have counties in between. Larger counties will often have a board or council or something like that, but even then, they often do not have any centralized government infrastructure like states or even fairly small towns have.
Counties will usually have a sheriff and a coroner and a bunch of offices that are just related to recordkeeping (like the registrar for marriage licenses, etc.), and a lot of these positions are, by longstanding tradition, elected, though it varies from state to state (and sometimes county to county). In some states, even the coroner is elected. In some states, the sheriff is the coroner. Of course, the lowest level court system is also county-based, and judges are usually elected as well.
To summarize, I think that a lot of these extraneous positions are relics of the past, of a time when county governments did a lot more in terms of the day-to-day management of a place because people could not easily travel to the state capital and city governments (much less cities themselves) had not yet developed to the extent that they have now. As counties did not then and still often do not now have the infrastructure to vet people for these positions, they were and still are just left up to the people by popular vote.