On one hand we have this lemma: let $A_1\rightarrow A_2 \rightarrow A_3\rightarrow 0$ be exact sequence of G-modules. Then $0\rightarrow \text{Hom} _G(A_3,M)\rightarrow \text{Hom} _G(A_2,M) \rightarrow \text{Hom} _G(A_1,M)$ is exact sequence of Abelian groups.
But on the other hand we have definition of group cohomology: let $\bf{P}\rightarrow \mathbb{Z}$ be projective resolution of $G$-module $\mathbb{Z}$. Form new sequence: $$ \ldots \rightarrow \text{Hom} _G(P_{n-1},M)\rightarrow \text{Hom} _G(P_n,M)\rightarrow \text{Hom} _G(P_{n+1},M)\rightarrow \ldots $$
Cohomology groups are $H^n(G,M)=\text{ker } \delta _{n+1}/\text{im } \delta _n$ (where $\delta _{n+1}: \text{Hom} _G(P_{n},M)\rightarrow \text{Hom} _G(P_{n+1},M)$).
But according to the lemma above this sequence should be exact ($\text{ker }\delta _{n+1}=\text{im }\delta _n$, cohomology groups should vanish). What am I missing?
edit: fixed the lemma.
The issue is that instead of applying $\operatorname{Hom}_G(-,M)$ to $P_\bullet \to \mathbf{Z} \to 0$, you should be applying $\operatorname{Hom}_G(-,M)$ to $P_\bullet \to 0$. That is, you would be right that since $$\cdots \to P_1 \to P_0 \to \mathbf{Z} \to 0$$ is exact, applying $\operatorname{Hom}_G(-,M)$ would give $$0 \to \operatorname{Hom}_G(\mathbf{Z},M) \to \operatorname{Hom}_G(P_0,M) \to \operatorname{Hom}_G(P_1,M) \to \cdots$$ which is also exact up to $\operatorname{Hom}_G(P_0,M)$. On the other hand, in the definition of derived functors you apply your functor to the resolution $P_\bullet$, without the augmentation to $\mathbf{Z}$, i.e., we take the sequence $$\cdots \to P_2 \to P_1 \to P_0 \to 0$$ which is not exact at $P_0$ anymore, and apply $\operatorname{Hom}_G(-,M)$ to give $$0 \to \operatorname{Hom}_G(P_0,M) \to \operatorname{Hom}_G(P_1,M) \to \operatorname{Hom}_G(P_2,M) \to \cdots$$ which we have no information about from your Lemma. Group cohomology is the cohomology of this complex.