Killing them without a reason is that the ants perform Tasbeeh of Allah Ta’ala.
There is a (Hadith in Zujajatul Masabeeh, Vol. 3, Pg. No: 319)
Translation of Hadith: It has been narrated on the authority of Hadhrat Abu Hurairah (May Allah be well pleased with him) that the Holy Prophet (Sallallahu alaihi wa sallam) said: An ant stung a Prophet. He ordered that the ants should be killed. The colony of those ants was burned. Allah Ta’ala sent him a Wahi (revelation): Only 1 ant had stung you, but you burned such an Ummah among the Ummahs, which used to perform Tasbeeh of Allah Ta’ala.