The spleen acts as a filter against foreign organisms that infect the bloodstream, and also filters out old red blood cells from the bloodstream and decomposes them.
The main function of the spleen is to filter the blood and remove unwanted red blood cells.