Coasters don't cost that much, though. The fact that CR is longer wouldn't be a significant increase in the price. Constructing a building is obviously more expensive than not constructing one, but the amount of money spent on Hagrid's for theming (sets, AAs, etc.) should make up for a lot of the difference, since CR doesn't really have much of that.
Expedition Everest is another good example; it's more impressive than CR in basically every way other than the actual coaster experience, and it involved building a major structure that's also themed plus an elaborate queue. It only cost $100 million. Of course things are more expensive now, and not solely from inflation, but that's not enough to account for a 5x cost increase for something that feels much cheaper in execution.
There's just little to point at with CR, including the fact that it's indoors, that makes it understandable that it cost $200m more than Hagrid's. And I actually like the fact that CR is indoors for a space based coaster; they just didn't execute it well.
As for Disney -- obviously they're happy that the ride is a big success, but I think it's arguable whether they think it was worth the price tag. If they built two $250m attractions that were major successes, that's a lot more helpful to them than one $500m attraction. They don't have an unlimited budget.