If the axiom of replacement implies the axiom of specification, why are both mentioned

Two reasons, one historical and one technical.

The historical reason is that when Zermelo first formulated the axioms of set theory (Zermelo set theory), Replacement was not an axiom. That was Fraenkel's contribution later on, giving us the more familiar ZF axioms. (Well technically Skolem/von Neumann also contributed the axiom of regularity).

The technical reason is that in set theory one often considers structures that satisfy some partial collection of the ZFC axioms. For example, the limit stages of the von Neumann hierarchy satisfy all the ZFC axioms except Replacement. So we can say pretty succinctly that they satisfy ZFC minus Replacement, instead of the more mouthful "they satisfy ZFC minus Replacement plus Specification".