You can't take it with you, but you can't leave it for someone else either: Valve says you aren't allowed to bequeath a Steam account in a will
First reported by Ars Technica, ResetEra user delete12345 has made an interesting discovery about Steam libraries: we're not allowed to bequeath them to our loved ones in the event of our untimely passing.
Delete12345 asked Steam Support about the hypothetical scenario, and got a clear, professional, but very disappointing response. "Unfortunately, Steam accounts and games are non-transferable," the support rep explained. "Steam Support can't provide someone else with access to the account or merge its access to another account.
"I regret to inform you that your Steam account cannot be transferred via a will."
Now, I was going to suggest that you can just give your designated heir the Steam login and password without getting lawyers involved—barring a sudden tragedy or Knives Out-style scenario where your grasping heirs are at each other's throats trying to secure your estate, that should work perfectly fine. But it turns out that would be in flagrant violation of the Steam Subscriber Agreement.
"You may not reveal, share, or otherwise allow others to use your password or Account except as otherwise specifically authorized by Valve," the document reads. And if that wasn't clear enough, it also refers to password sharing as a "violation of this confidentiality agreement" a little further down.
So you heard it loud and clear, folks. Unless you want to take on the mortal sin of breaking the iron law of End User License Agreement just as you slip this mortal coil, forever cleaving your soul from God, grace, and Gabe Newell, you just gotta let that library lie fallow after you're gone.
If, however, you insist on your progeny taking up your very same $1,500 Counter-Strike 2 AWP with some kind of ugly graffiti dragon on it, slipping your issue the account username and password in contravention of the sacred EULA you signed (no doubt having read the whole thing several times over), I suppose that's your prerogative.