Is there a historical or grammatical reason for spelling hiccup with two c's?


Etymonline.com gives earlier spellings and foreign spellings:

hiccup (n.)
1570s, hickop, earlier hicket, hyckock, "a word meant to imitate the sound produced by the convulsion of the diaphragm" [Abram Smythe Farmer, "Folk-Etymology," London, 1882]. Cf. Fr. hoquet, Dan. hikke, etc. Modern spelling first recorded 1788

And:

hiccough
1620s, variant of hiccup (q.v.) by mistaken association with cough.

So before standardisation of English spelling (orthography), the onomatopoeic hiccup had many variations. We can see some of these in the 1831 A critical review of the orthography of Dr. Webster's Series of Books for Systematick Instruction in the English Language.

And from the Sesquiotica words, words, words blog:

So anyway, this irritating thing produces a sound. Want to name it? Imitate the sound. For the most part, Western European languages don’t have a glottal stop as a separate phoneme, and certainly not a strong enough one to do the job here – uh-uh – so a /k/ will do, and /h/ for the sharp intake before it. Dutch has hik, as does Danish; Swedish has hicka; Breton has hok; French has hoquet and Latin has hoquetus; and English had, first, hicket and hickock (with various spellings, including hitchcock) and shortly thereafter hiccup, which from the 16th to 19th centuries showed a variety of alternative spellings: hicke up, hikup, hickop, hickhop, hecup, hiccop, hickup, hick-up

And somewhere in the 1600s, someone apparently got the idea that this word had come in part from cough. This was a time when words were being respelled by some people on the basis of their origins (real or false), which is how we got such weird messes as debt, people, and island (see “What’s up with English spelling”). Sometimes the pronunciation changed, as with falcon (formerly faucon). But in the case of hiccough, the spelling was simply changed to reflect what was mistakenly thought to be its origin, but the pronunciation was kept the same.

As FumbleFingers suggested in a comment, it's a fair guess that after the ck had been lost to hiccough (due to a mistaken hic + cough) back in the early 1600s, the cc stuck around for the modern hiccup spelling of the late 1700s.