It seems like a case of motivated reasoning. Doctors needed to operate on babies; anesthetizing them would be hard. So they decided that babies can't feel pain and never investigated methods of anesthesia on babies.
More like anesthetizing them would be risky and they're not gonna remember it so it's not worth the increased risk to their life since infants are already fairly fragile and saving their life is the primary goal.
It's not just "it's hard and we're lazy so lets make up an excuse" like you seem to be implying.
Edit: Since apparently it wasn't clear, we're talking about the timeline when this issue was hashed out, so the 1980s. Anesthesia carried substantially more risk then because back then we didn't understand it nearly as well.
We anesthetize infants fairly often now[1]. It's still a bit risky, but it's fairly common. It's gotten less risky because we do it a lot and have gotten quite good at it. If we'd never revised the science on infant pain, we never would have even bothered to try. Turns out, it's possible to do it fairly safely.
It's one thing to say, we're not going to use anesthesia because it's too much risk, it's another to say that they don't feel pain at all so let's not worry about it.
We're better at anesthesia now, but would we have ever gotten good at anesthetizing babies if we kept believing that they didn't feel pain in the first place? Why bother working out how to do it if we think they don't feel pain?
It's not just "it's hard and we're lazy so lets make up an excuse" like you seem to be implying.
Edit: Since apparently it wasn't clear, we're talking about the timeline when this issue was hashed out, so the 1980s. Anesthesia carried substantially more risk then because back then we didn't understand it nearly as well.