It's going to be quite a challenge to give a definitive answer to any "Why" question about law, and especially so for a question about tax law. One would need to try to dig up statements made by the legislators (and/or their aides) crafting and debating the law. As it is, tax law is already inconsistent in many ways. (Why are there people who can't contribute to a Roth IRA directly but can contribute to a Traditional and then immediately convert it to Roth? Why are maximum limits for 401(k) plans and IRAs separate rather than being one combined "retirement" savings maximum?)
In the absence of some specific legislative statements saying that it was set up this way for some specific purpose, one must assume that it was written with the some goals as all tax law: As a compromise between various ideas, trying to accomplish some specific purpose. Feel free to add in some level of inefficiency and it being hard to completely understand the entirely of the tax law, which leads to things perhaps not being as "tidy" as one might hope for.
But there's no reason to think that the people crafting the tax advantages for HSA plans had any reason to use 401(k) plans as a template, or wanted them to accomplish the same goals.