Good question. The general consensus seems to be that it enables a primitive form of magnetoreception,
Kirschvink thinks magnetite is the key. Receptor cells containing crystals of magnetite could register changes in magnetic fields and report this information to the brain. This is almost identical to what magnetotactic bacteria do. They have structures containing nanoscale magnetite crystals called magnetosomes. These essentially act as biological compasses, allowing the bacteria to navigate.https://www.realclearscience.com/blog/2019/06/11/why_is_there_magnetite_in_the_human_brain.html
Apparently research has shown that humans may have some small degree of magnetoreception.
Magnetite is widely distributed in the brain but especially concentrated in the brainstem and cerebellum. It also seems to be produced by the brain’s own chemistry, so it might play an important role doing something.
Another alternative that occurs to me is that magnetite plays some role in neurons that increases sensitivity to the brain’s own EM field.