For this study on "Hospitalization and Mortality among Black Patients and White Patients with Covid-19":
The models for in-hospital death all considered time to death, with data from patients discharged alive or still admitted treated as censored observations.
That type of censoring is standard practice. Censored cases had not yet had the event (death) at the time of last observation, but information from them up through that time contains information about the hazards up to their last observation time.
For this study on "Hydroxychloroquine in Hospitalized Patients with Covid-19":
The primary end point was the time from study baseline to intubation or death. For patients who died after intubation, the timing of the primary end point was defined as the time of intubation.
Again, it would be standard practice to treat as censored both (1) those who were discharged without being intubated or dying and (2) those still in the hospital but not yet having the event. As in the paper discussed above, those individuals had not experienced the defined event by the censoring time and thus information from them up through the censoring time ought to be included in the model. One could have considered other ways of modeling those who were discharged without intubation or death, as a competing event or with a cure model, but those alternative modeling strategies would not have affected the interpretation of results with respect to the primary end point of interest in that paper. I take no stand on whether that type of endpoint makes sense clinically, but if that's the event definition then the statistical handling of censoring is correct.
This paper on "Ethnic and regional variations in hospital mortality from COVID-19 in Brazil" is a bit troubling. The authors limited their Cox models for in-hospital mortality to patients with "known outcome." That omits information from those still hospitalized but not yet having died. That approach can be OK if those missing event times can be considered "missing completely at random" (MCAR) in a technical sense. It's hard, however, to document MCAR in such a study (it doesn't seem that these authors did so) and if MCAR doesn't hold then there is a risk of bias in the results. If anything, as this question puts it:
removing the patients who are still hospitalized but have not experienced the event when the data collection ended
certainly did not solve any problem and it might have introduced unnecessary problems.