TL;DR:
It's a classic case of technological advancement vs. installed base
In the early days of electricity-based communication (i.e., telegraph and later TTY) there was no way to detect a voltage and, when needed, amplify it.
Only current flowing in a closed circuit could be detected reliably—by having it run through a coil which in turn moved a lever—and amplified as well—by having that lever move a switch that closes another (next) circuit.
At the time voltage based interfaced became possible it stand against a huge installed base - and existing equipment - using current interfaces. Computers, the ones promoting voltage based most, had to arrange with existing hardware, until gaining enough of a market to make it worthwhile to invest in new production.
The Long Story
[All of the following is quite simplified as the steps taken and the associated learning curve was quite complex]
When telegraph became a serious application, there was only one device that could transform an electric signal into something useful, a coil: When current is applied it generates a magnetic field, able to pull some magnetic lever, which in turn can be used to operate something, like a bell, a pen or whatever (*1).
The magnetic field generated is independent of voltage, but directly proportional to the current flow (*2). To make it work, a certain amount of current is needed, such as 50 mA. As soon as that current flows, the coil will pull its lever. Since pulling with more force isn't a big issue, this also provides an inherent handling of overcurrent (within reason).
So much for the receiving side. With the sender, voltage comes into play, as the amount of current delivered over a line is directly proportional to its length (its resistive load). So it was possible to calculate the needed voltage to for a given line length, which then was fixed for that relation. To simplify, companies tried to use only sections of equal length. Sections could be chained by combinations of coils and switches operated by the lever, switches that closed the circuit of the next section. Today we might call this a digital amplifier, but back then they choose relay, like the familiar stations on a stage coach line.
So genuine telegraph and teletype communication was current-based. Soon many lines were built in a real boom, setting up a current-based infrastructure. Of course there were many other improvements, from power generation to power control, insulation to wire size and quality. And not least an incredible variety of devices based on coils pulling levers—the integrated circuits of the 1890s.
Current-based networks rule digital communication, and a huge number of users attract a good number of manufacturers supplying teletypes, teleprinter and other related equipment. Current-based interfaces were the industry standard for such devices.
This is essentially the situation at the advent of computers. By now voltage-based interfaces were possible, not least due to the transistor which drove computer development as well. They are simply the way a computer work internally, so using them with external components would have been a great thing—except, all easy-to-get terminal devices, aka teletypes, worked on current loop.
So the logical solution was simply to add interfaces that change voltage-based (serial) signals to current loop and back. Of course that additional effort is not really wellcome, so establishing RS-232 was quite appreciated and by the mid 70s essentially done.
In Detail
"more suitable for transmission over long runs of twisted-pair wiring" sounds like a really big advantage!
Not really. Or only with sufficient effort. After all the primary output of (most) computers was voltage-based.
Yet it seems the 20mA current loop was replaced by RS-232. Why? What advantage did RS-232 have to outweigh this disadvantage relative to the older technology?
It simplifies interfaces on the computer side—especially if both sides are using the same, voltage-based logic. No converting interface needed. Everything gets simpler with voltage-based interfaces—not to mention that they also allow higher transmission rates.
a company like DEC that made both the computers and the terminals, would have no reason to care about the standard, if it could get better signal transmission by making both computers and terminals use a different format.
The point is rather that even 'a company like DEC' started out small, so not really able to build a whole landscape right from start. In addition, there's the pesky customer, one that wants to use existing terminals, or ones available at a lower price from third party, or simply what they already have.
*1 - The folks back then became very innovative what to do with the little force a tiny lever pulled by a coil can operate.
*2 - Yes, the amount of current is of course related to the voltage applied, but that's beside the point.