Yeah he did, but his mind is broken. Like a computer program that won't execute core functions due to an error in code.
This is only a personal hypothesis, but I believe Sensei misses humans and wants to bring them back. I think the reason he won't pray away the spirits is because he knows that once they are gone, humans will never return.
I also think that is why he created the gems in the image of humans and why the spirits keep destroying the gems. I believe the spirits want sensei to hate them so much he destroys them, but unfortunately sensei is a machine and cannot feel, so it's a pointless exercise (spirits can't process this).
This is another personal hypothesis, but I think the end of the manga/story will be the same ending as Blame. I think Phos will continue to assimilate things into her body including the slugs and the spirits (she already kind of has with the spirit eye and the slug shell), until she reaches a point where she becomes almost human. Then there will be a death and rebirth arc where phos 'dies' and is reborn as a real human and sensei realises she has become what he misses most and grants the spirits wish and everybody lives happily ever after.