The size. Longer pianos, upright < baby grand < concert grand allow for longer strings and larger vibrating surfaces, meaning richer sounds and less opportunity for undesirable harmonics.
Grands also have more space for better mechanical apparatus from the keys to the hammers striking the strings.
And a grand having the cabinet with strings and sounding boards open to the audience sounds better than an upright sending sound into a wall.
Something else I haven’t seen mentioned yet: many upright pianos do not have a proper ‘una corda’ pedal.
Typical pianos have between 2 and 3 strings for each note, all tuned to the same pitch, so the sound is full and more easily heard. The hammer typically hits all these strings with each key press.
On a grand piano, the leftmost foot pedal moves the actual keyboard and hammer assembly slightly to one side so that only a single string for each note is struck (una corda = single string). This results in a sound more like that of a pianoforte which is almost harp-like in sound.
On many upright pianos I have seen, the left pedal simply lowers a felt strip in between the hammers and strings making the sound quieter. While this is similar, it may not be what the composer had in mind for the particular piece.
Another thing I didn’t see mentioned is the positioning of the strings and the opening of the piano lid. In a grand piano with the lid open, the strings are slightly above the base of the piano and the sound bouces up to the lid and out to the audience. In an upright piano with the lid open, the sound bounces between the walls of the piano before bouncing off the lid toward the audience. This will lead to a difference in tone and make the upright sound a little more stuffy than a grand piano.
Money.
Opinion.