Why was the Ka’bah destroyed? Why did Allah not stop it from being destroyed? I also heard that once some people stole the black stone for thirty years why would Allah allow this to happen didn’t he protect the Ka’bah during ʿām al-fīl

What Allah deems fit happens. If Allah allowed it to happen then there is wisdom behind it. The question why Allah does thing is not a wise question as He is the one who said in the Quran: He is not to be questions but they shall be asked.