Earlier quoted context omitted.
A carrier costs $10 billion. Without considering the crew and stuff in it. You can fire 50 $100 mil missiles simultaneously at it would still make a lot of sense, especially considering the morale aspect.
Regardless of missile cost, the hard part is getting an accurate targeting track and then data linking that back to a launcher. Satellites, aircraft, and submarines can all potentially accomplish that mission, but they only exist in limited numbers and are in turn vulnerable to the defensive weapons available in a carrier strike force.
It's hard to hide a strike group. Even civilians are tracking them these days with commercial sattelites:
https://www.forbes.com/sites/hisutton/2020/05/07/the-realiti...
US itself talks about sending out hundreds of cheapish drones in a swarm (5 km spacing) to seek out all naval assets over an area.