Mainly because it stimulates blood flow to the brain. During a workout this clears stress hormones and encourages dopamine release. This results in better sleep and increased motivation, which can in turn positively benefit your health and brain. And of course the brain needs about 1/5th of the body’s oxygen, so keeping the heart strong and arteries supple and encouraging capillary growth keeps up healthy oxygen levels.
Also when you exercise you are stimulating the nervous system, because the body’s movements are controlled by the nervous system. This is also the system your brain is a part of, and the result is like a “physical focus”; like meditation this reduces anxiety and also increases neural connections, which causes growth of new brain cells.
Basically the brain is part of your body, and keeping your body healthy keeps your brain healthy, which is good for it.