Whether an initial H is pronounced in French-derived words is fairly arbitrary, & its pronunciation in particular words has often changed over time.
The use of 'an' rather than 'a' before words in which the initial H is pronounced usually reflects a relatively recent change to the pronunciation of H.
It's therefore obsolete, & should be deplored. Before an H which is pronounced, 'a' should always be used. 'An' should only be used before a silent H. When the pronunciation of H changes, the use of a or an should follow suit.
Obey, or I'll start in with "an herb", "an hospital", etc.