I would like to tidy up some loose ends on the topic of the function of the kidneys. Some interesting discussion came up in the comment to this post, with people claiming that there is scientific support for Chazal's description. So here is a summary of what Chazal say about the kidneys, and what science says.
What Chazal say:
The kidneys advise us on what to do.
ALL cognitive functions relating to making decisions occur in the heart and kidneys.
NOTHING relating to this occurs in the brain. (see too Midrash Tehillim 14)
One kidney advises to do good, one to do evil (this is presumably intended literally, since it is stated immediately next to the statement about the function of the organs).
When God wants to judge whether we are good or not, He examines the heart and kidneys, not the brain.
What science says:
The kidneys filter blood. Cognitive functions such as making decisions occur in the brain.
A decline in the function of kidneys is also associated with memory loss (nothing to do with making decisions). Furthermore, this is not because the kidneys themselves affect the brain, but rather because diseases and problems that affect kidneys can also affect the brain.
There is no difference between the function of the right and left kidney.
A person can survive without kidneys, via dialysis, without being affected in their moral decision-making process.
A person can live on one kidney without turning good/evil.
If God were to assess someone's moral worth, He would check their brain (or that which is housed in their brain), not their kidneys and heart. It wouldn't make a difference if they had a kidney transplant.
I also noticed that in the Nishmas tefillah (which is of uncertain authorship and origins), it is made clear that it is the heart and kidneys, not the brain, that house a person’s consciousness:
For every mouth is in acknowledgement to You, and every tongue swears to You, and every knee bows to You, and every erect spine prostrates itself to You, and all hearts fear You, and all innards and kidneys praise Your Name, as it is written, “All my bones say, Who is like You, O God.”
It's fascinating that in English siddurim, they do not translate kelayos as kidneys, but they do translate lev as heart. Apparently it's a given that "heart" is not literal, but not that "kidneys" is not literal!
It's clear that Chazal truly believed that the kidneys provide moral counsel to the heart. I don't think that all the Rishonim and Acharonim who defended this view, and the modern Poskim (e.g. Tzitz Eliezer) who object to kidney transplants as a result, misunderstood Chazal.
And I don't think that Chazal misunderstood Tenach. In fact, I think that the pesukim are unequivocal: "You are present in their mouths, but far from their kidneys" (Jer. 12:2); "I, God, probe the heart, and examine the kidneys, and repay each man according to his ways, with the fruit of his deeds" (Jer. 17:10).
I think that this is a perfect case to adopt the approach of dibra Torah k'lashon bnei Adam - and a justification for the strong version of this principle.