You can also look at the value as discounted future cash flow. And in that calculation, an empty apartment that the buyer is confident they can fill quickly and rent for $5k is worth more than a full one renting for $4k.
Also, if you take your reasoning to the extreme then an empty apartment building has a negative value.