When garlic sprouts it's still safe to eat and does not mean that the garlic has spoiled because of sprouting.
When garlic starts aging it begins to sprout and also develops a sharper and spicier taste to the garlic.
Some people say that the sprouted garlic tastes bitter and they do not like the sprouted garlic while other people tend to like the spicier and more bitter taste of the sprouted garlic.
You can still safely eat the sprouted garlic if you want too and there's no need to throw it out if it has sprouted however it's all in the taste.
Garlic is still good when it's sprouting but it just tastes different and that's all.