If it's specifically about feedback on the whiteboard exercise, I find the legal excuse to be a bit weak. It is something organizations will hide behind because it's a lot easier to say, "I'd love to give you feedback, but HR/Legal says we can't because of liability concerns." That makes the company look like the good guy, just blame the system.
Specifically on the whiteboard, the primary reason for not providing feedback is very simple - HR and managers have jobs to do, and they're going to focus on their primary duties on the business side, and active candidates on the HR side. Once you didn't pass the exercise, they're not going to spend time on you because that's inefficient for them - essentially sinking someone's time to write you feedback when you ultimately won't be working for them.
In the US, anyone can be sued for anything, so it is technically true that there's a legal reason not to give feedback there. But I think the risk of that takes a back seat to simply not wanting to spend the time on something that isn't seen as valuable to the company even if it is to the excluded candidate.
Now, as to everything else, particularly "fit" and all of that - yeah, there's a very valid legal risk that would suggest you should not provide that feedback. Fit is subjective, and a lot easier for someone to decide fit meant age/race/sex/etc.
My final opinion is that this type of feedback wouldn't actually be useful. It sounds like it would be, but that suggests that hiring orgs all think the same. They don't, and that's good for all of us.