Because medical technology in the 25th century is more advanced. Many more wounds and illnesses can be treated in the field or in the comfort of a crewperson's own quarters, and the recuperation time for a typical sickness or injury is much shorter, so far fewer beds are needed.
Current day parallel: there are less than half the number of hospital beds in the US today compared to 1960.
Additionally, the TNG Technical Manual species that the holodecks and shuttlebays can be converted into emergency wards for mass casualty situations, but not normally required.
That's the answer I was looking for. Thank you so much