It is because during fever bacteria(Outsider microorganism) attacks our immune system. To fight, our body produce antibodies(cells to fight bacteria). And bacteria are sensetive to temperature they die in high temperature. So our body increases temperature.
It is because when our body temperature increase. It can lead to burst of our brain nerves.