This study answers a simple question: "If I deploy this treatment to x people, how will this affect the outcomes of those people over the next y months (where y is roughly the same as the study length)?" And this sort of study, when impartially carried out, can provide a reasonably accurate answer to that question.
I fully agree that there are plentiful problems with this. Such a study would conclude that smoking cigarettes is perfectly healthy! But going beyond that is generally not possible in any meaningful way, because one cannot see into the future. For instance you now claim, with hindsight, that effectively 100% of people will be infected by COVID. Yet at the same time these studies were happening, we were carrying out actions, ostensibly well informed and in good faith, that promised to be able to effectively eliminate COVID if we just e.g. shut down the country for 'x' weeks.
And so you now want to compare risk(COVID) vs risk(vaccine), but these vaccines ultimately proved themselves unable to meaningfully prevent COVID infection or spread. So instead you need to compare risk(COVID) vs risk(COVID + vaccine). And similarly the vaccines also ended up with brief periods of efficacy, so again you need to factor in yet another variable: risk(COVID + vaccine + boosters x time).
And that's really just getting started. Imagine trying to factor in completely unknowable, yet inevitable, viral mutations. Ultimately, these long term models are more likely to reflect the biases of the person building them than any actual relationship to expected outcomes. And when there are tens of billions of dollars at stake for a model to give the "right" answer, I don't think this is anything we ought ever aim for. Like in software, KISS. [1]
[1] - https://en.wikipedia.org/wiki/KISS_principle