Because humans and jinn (in where satan came from) created by Allah for being tested. Satan failed in the first test. So, he demanded a term of respite from Allah as a requirements of His Wisdom, Almighty. Allah granted him in a term of respite until Doomsday. When Satan didn't frustrate Adam, he dismissed from divine mercy and upon to his demand and as a result of Divine wisdom, he was given authority to disturb and deviate human until Doomsday.