The previous base unit, gram, was replaced by the kilogram in order to obtain coherence with the practical units ampere and volt.
In 1874 the mechanical units cm, g, s ('CGS') were adopted as the coherent system of units for science. In 1881 the CGS was coherently extended with the “absolute" electrical units abampere, abvolt, abohm. Coherence in this case primarily means that electrical energy and mechanical energy have identical units: $V\ I\ t = F \ L$. Unfortunately, the abvolt, abohm, were inconveniently small. Another inconveniently small unit was the unit of mechanical energy, the erg (=1 g⋅cm/s2).
In 1881-1889 the 'practical' units electrical units ampere, volt, ohm, and joule (1 joule = 1 V⋅A⋅s = 10^7 erg) were introduced for practical use. Their magnitude was convenient, but they were not coherent with CGS. In 1901, Giorgi pointed out that the practical units are coherent with m, kg, s.
Derivation: $[E] = [F\cdot L] = [(M\ L\ t^{-2})\ L] = [M]\ [L]^{2}\ [t]^{-2}\rightarrow$ $\rightarrow [M] = [E]\ [t]^2\ [L]^{-2} = 1\ J s^{2} m^{-2} = 1\ kilogram$
Because of this, the scientific community adopted the SI system in 1960, with the kilogram as base unit.
In summary: the kilogram became the base unit because it is coherent with the joule, which is derived from the practical units volt and ampere.
(source: Jayson, Amer. J. Phys. 82 (2014) 60)