Why do you think back catalogs of nucleoside analogues exist?
Also, sure it was patented earlier than remdesivir, but patent term is 20 years - GS-441524 has 9 more years on patent. Plenty of exclusive value that Gilead can extract.
There's plenty of arguments against patents in software and other innovations. But not many people complain about it for drug research where the timelines and type of research actually make sense for such a system.
If our patent system didn't exist, the drug would have never been developed in the first place.
Prove it.
Actually greed and the patent system provide an extremely profound incentive for saving lives.