For an abelian group $G$, the Eilenberg-MacLane spaces $K(G,k)$ assemble to a spectrum $HG$ with $HG_k=K(G,k)$. This spectrum has the property that $\pi_0 HG=G$ and $\pi_{n}HG=0$ for $n\neq 0$ where $$ \pi_nHG=\underset{k\to\infty}{\operatorname{colim}} [\Sigma^{n+k}\mathbf{S}, HG_k] $$ is the $n$-th stable homotopy group as usual.
This is probably a stupid question: Why is every spectrum $X$ with $\pi_0 X=G$ for an abelian group $G$ and $\pi_{n}X=0$ for $n\neq 0$ (stably) equivalent to $HG$?
Even if a map $X\to HG$ of spectra can be constructed (which I don't know) it is not clear to me why the induced map $G=\pi_0X\to \pi_0HG=G$ would be an isomorphism.
Try to use the the uniqueness (up to homotopy equivalence) of Eilenberg-Maclane spaces to show that if $\pi_0 X = G$ and $\pi_i X = 0 $for $i > n$, then for some n onwards,you have that $X_n$ is homotopy equivalent to an Eilenberg-Maclane space.
With this you get maps defined on a cofinal subset, which induces homotopy equivalences of $X_n$ with the corresponding Eilenberg-Maclane space. Clearly it must induce a homotopy equivalence of $\pi_0$ as well (as it only depends on a cofinal subset of a spectrum).