It is biologically useful to have a barrier between the central nervous system and the rest of the body. Blood often carries amino acids, alkaloid toxins, and other chemicals that can interfere with neurological processes, such as synaptic transmission. The blood-brain-barrier is highly selective and prevents these things from passing through the membrane separating the brain and the rest of the body. So, the evolutionary advantage is an exceptionally clean space for the brain’s unique cells to function ideally; and a means to ensure that pollution does not enter, and is removed and not easily passed along in the brain cells.
The walls of brain capillaries are much tighter than those of the rest of the body. So, it is difficult for blood to pass between blood cells in the brain as compared to the more ease of passage in bodily blood cells. The cells of the brain are also less porous and overall allow fewer transmissions in and out. Furthermore, when something does manage to penetrate the brain cells a specialized pump in the membrane will activate to remove the intrusive molecule. Thus, the nature of cells in the brain protects it, like a force-y field-y thing, from exotic molecules. Notably, though, this exclusion would include medication for brain disease.
There has been a relative lacking in research and institutionalization to determine how to supply the brain with already developed drugs that can treat many brain-related diseases. However, there are recent developments that are promising and potentially effective at penetrating the tricky blood-brain-barrier. One clever way is with endothelial-cell transport proteins. These proteins are used to deliver items the brain normally needs, such as nutrients and hormones, through the b-b-b. The researchers can manipulate these transporters by convincing them to to bond to a medication.
A precursor defense to the b-b-b is a sensor in the brain-stem that measures blood and will induce nausea if something is beyond its threshold for normal. Whether it’s a pathogen, inhaled fumes, sugar, or ethanol the blood will have a different pH/charge and the variability may trigger a guttural instinct to vacate your stomach.