This can have various causes. One could be that the fermentation time was too long and the lactic acid bacteria had too much time to produce lactic acid for your taste. Another cause could be that the temperature during fermentation was too high.
Also note that even if you put the yoghurt in the fridge, it will still sour. If you know it will be awhile before you eat your yoghurt, use a shorter fermentation time.