Q: Is there ever a situation where the DM ought to keep track of a player character's hit points, and not reveal it to the player?
TL;DR: Yes, with a few caveats, to reap the benefits of increased immersion, suspense, and sense of danger / uncertainty.
From my favorite example ... some points to make it successful.
1. Small Party Size
We played small groups of thieves running in OD&D (pre-1e AD&D). The setting was Judges Guild "City-State of the Invincible Overlord." The parties were small (2 or 3 at a time). The DM rolled our HD and simply told us "you feel strong today" "you feel average" or "not feeling your best today." We then hit the mean streets of the City State.
- Note: Our DM limited the size of parties for two reasons
a. Large parties required too much admin work, slowed play down.
b. Getting people together for a raid/adventure was easier.
c. Game sessions took less time. (We were all time-constrained).
2. Character Level/Simplicity
We didn't use characters beyond 4th level. As characters grow and skills increase, the complexity of decision making increases. We were goal oriented, leading us to ...
3. Mission/Task Oriented Play (Not long term campaign play).
The objective of our Low Level Thief missions was to earn enough levels to be accepted into the Thieves' Guild. (Fourth Level/Burglar).
There was a twist: as freelancers, if we ran across Guild Members (we had been warned) ... we found that encroaching on their turf had consequences!
The one group (where all three succeeded) discovered a second twist: they had to accept a final (hard / scripted) mission from the guild master to get their "guild card."
Added benefit: because this DM was so good and so respected in our gaming club, characters from his campaigns were always transportable to other campaigns. Such cross pollination wasn't always the case (and may not be now for some DM's). His gritty-realism style got us, as players, to dig deep and be resourceful to successfully complete adventures. Combat was the least common means of achieving our objectives.
4. Gritty Realism Contract Agreed
This worked because we agreed ahead of time that all characters were dealing with the City-State's criminal underworld: a nasty group if ever there was one. Some of us "died trying" to get into the Thieves' Guild.
5. The Payoff
We did this in 1978. I write this in 2015 and will still say that these were the most memorable adventures I've ever been in regarding immersion, teamwork, and living with every "fight or flight" decision.
6. To sum up:
a. Can it be done? Yes, within the scope of what we found to be successful.
You will increase immersion, suspense, and sense of adventure/danger.
b. Could you do this in a campaign? Probably, but I haven't seen that done. I'd suggest that a co-DM be around to help with the admin side so that the DM can focus on immersion. In any given gaming group, this depends on the people involved for a "we can" or "we can't" do that.