Once you enter Hardmode, any Mechanical Boss you haven't defeated yet has a small chance to spawn every night. This is most likely what happened to you, and not related to the altar.Why the the destroyer woke up 5 minutes after i destroyed the altar?
It actually can only happen after breaking an altar. If you leave the altars alone you can prevent them from spawning naturally.Once you enter Hardmode, any Mechanical Boss you haven't defeated yet has a small chance to spawn every night. This is most likely what happened to you, and not related to the altar.
Mechanical Bosses announce their arrival in the chat window. If you see a message like "You feel vibrations in the earth below", a Mechanical Boss spawn is imminent.