The purpose of the kidneys is to filter waste from the blood, and other things like water, glucose, amino acids, some minerals/vitamins, and other small molecules can also get filtered out. Reabsorbtion of water in the kidneys allows the body to maintain a fluid balance (drink a lot and you pee more cause you have an excess of water). As for the other aforementioned things, they're often needed for metabolic processes (such as certain enzyme functions) so loosing it to waste decreases efficiency and efficacy of other bodily processes.