Solar energetic particles (SEPs) in the energy range 10s KeV/nucleon - 100s MeV/nucleon originate from the Sun. Their high flux near Earth may damage the space-borne electronics and generate secondary radiation that is harmful for life on Earth. Thus, understanding their energization on the Sun is important for space weather prediction. Impulsive (or $ $He-rich) SEP events are associated with the acceleration of charge particles in solar flares by magnetic reconnection and related processes. The preferential acceleration of heavy ions and the extraordinary abundance enhancement of $ ^3$He in the impulsive SEP events are not understood yet. In this paper we study the acceleration of heavy ions and its consequences for their abundance enhancements by magnetic reconnection, an established acceleration source for impulsive SEP events in which heavy-ion enhancement is observed We employed a two-dimensional hybrid-kinetic plasma model (kinetic ions and inertial electron fluid) to simulate magnetic reconnection. All the ion species are treated self-consistently in our simulations. We find that heavy ions are preferentially accelerated to energies many times higher than their initial thermal energies by a variety of acceleration mechanisms operating in reconnection. The most efficient acceleration takes place in the flux pileup regions of magnetic reconnection. Heavy ions with sufficiently low values of charge-to-mass ratio ($Q/M$) can be accelerated by pickup mechanism in outflow regions even before any magnetic flux is piled up. The energy spectra of heavy ions develop a shoulder-like region, a nonthermal feature, as a result of the acceleration. The spectral index of the power-law fit to the shoulder region of the spectra varies approximately as $(Q/M)^ $. The abundance enhancement factor, defined as the number of particles above a threshold energy normalized to the total number of particles, scales as $(Q/M)^ alpha $, where alpha increases with the energy threshold. We discuss our simulation results in the light of the SEP observations.