What you have shown is that there are two different complex numbers whose square is $i$. I am guessing that your confusion is that you think of the square root as a function. That is, for each input, you should only get one output.
For real a real number $a >0$ you also have two numbers whose square is $a$. We choose the positive of these are the square root of $a$.
For complex numbers things are a bit more tricky because you again have two different solutions to an equation $z^2 = a$. For example $i^2 = 1$ and $(-i)^2 = 1$. So how do you pick which one should be $\sqrt{-1}$?
For this question, please see this question/answer: How do I get the square root of a complex number?
The basic answer is that square roots of complex numbers aren't in general defined.
Well what about $\sqrt{-1}$ then? Here we usually defined $\sqrt{-a}$ (for $a >0$) to be $\sqrt{a}i$. It is just a matter of definition.