The Hunter Killers surely have the ability to see in infrared and have night vision capabilities.
Having the spotlights just makes it easier for the Resistance to locate them and take them out.
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.Sign up to join this community
Even if you can see into the far infrared, to identify objects by their own natural heat glow, it is much easier to distinguish objects if they are well illuminated. Skynet presumably made a cost-benefit analysis and decided that its robots would be more successful with spotlights; the lights make it easier for the hunter-killers to spot their prey, although at the same time, they make the HK's themselves easier targets. Whether it makes sense to include lights depends on the details of the situation.*
Moreover, this cost-benefit analysis may have been completed at an earlier stage of the Judgement Day conflict, before John Connor had organized an effective resistance to the machines. Skynet may have a lot of hunter-killers that were optimized for combat against a relatively passive human population. Although they are less useful against Connor's well-trained forces, they remain in service until they are destroyed.
(*Actually, it seems like the optimal solution would really be to use narrow-band near infrared spotlights, which would be as good as visual light for illuminating the HK's targets, but which humans would not be able to see without night vision equipment. Maybe Skynet did not think of that until it was too late.)
Although the first film (The Terminator, 1984) offers no explanation for the machines' use of spotlights that are visible to humans, later films(1) show that much of Skynet's "future war" technology follows closely from present-day designs created by humans. It may be that the visible-light spotlights on the hunter-killers are vestigial structures, left over from the original designs made by humans (with human biases) for direction by humans.
The HK (Hunter-Killer) Tank (left; first appearance in The Terminator) seems to be a larger and more powerful version of the T-1 (right; first appearance in Terminator 3: Rise of the Machines):
Similary, the HK-Aerial (The Terminator) resembles an HK-Drone (Terminator 3)...
...and the T-1000 (Terminator 2: Judgment Day) resembles the T-1000 protoype (Terminator Genisys):
Even the iconic T-800 model 101 (The Terminator) and others portrayed by Arnold Schwarzenegger are based, in-universe, on the physical form of Sergeant Candy and the voice of an unnamed Cyberdyne employee (cut scene from Terminator 3: Rise of the Machines):
(1) The canonicity of these films may be questionable, but that's a topic for another discussion.