SCOTUS certainly hasn't interpreted it "as written", but has been happy to "evolve" it.
That's a good question. And the answer is yes.
At the time it was written, that phrase would roughly mean well-organized, well-armed, well-disciplined. Not regulated in the way we use the term today, to refer to something governed by regulations.
"A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed."
Maybe you'd be happier if it said:
"The right of the people to keep and bear Arms while they are members of a well-regulated militia shall not be infringed."
I am sympathetic to both sides of the jurispredential pragmatism/literalism question, but don't get your eggs twisted about what the 2nd amendment says, as only the most alien of consciousnesses could find ambiguity in its terse declaration.
So maybe we need the well regulated Militia, because that seems absent, though the Constitution says it is necessary.
They don't treat the law as perfect, they just believe they don't have the leeway to reinterpret the law as they want in contradiction of the text. The law doesn't work if justices can read between the lines to get what they want.