Because having a fever raise your body temp and bacteria need a specific clime and acidity to survive and prolifer, so could help to stop the advance of bacteria.
But, you need to keep an eye on it because high fever can cause the bad function of body systems and regulations.