Yes, it is advisable to spray ant killer on trees because this will prevent ants from getting into the tree's trunk and spreading damage to the tree.