Why do my cakes turn mouldy?
This is completely  normal.   Cake is a perishable item, much like almost any prepared food.  It will spoil if left out unprotected.

Although during the baking process, almost all bacteria and molds that are present in the batter will be killed or reduced to trivial numbers, there are still countless mold spores present in the air. 

The cake can also absorb water from the air if it is very humid (you mentioned the rainy season).

If the cake does absorb water (as opposed to drying out and getting hard), it will present a hospitable environment to the mold spores that settle from the air, and they will begin to grow.  Very warm conditions only help to accelerate this process.

This is essentially the same process described in the answer to this question:
Is bread that can go mouldy better than that which does not?



Two of the best sources for shelf life agree that an non-refrigerated cake should last 1-2 days.  These sources probably assume prevailing conditions in the US, including air conditioning in the summer.  They are also looking at quality; cakes are also subject to staling.


Eat By Date - How Long Does Cake Last
Still Tasty - Butter Cake, Unfrosted