This thread has some answers about that, but the short answer is: etymology. Different derivations, and the language only being standardized somewhat recently (post WWII) means that there will be some exceptions to general rules.
Quick question about 氷 - Japanese Language - WaniKani Community
Specifically for こおり, it used to be こほり, and has been standardized to こおり now instead.