Spells are not affected by gravity unless otherwise noted
Really, it shouldn't matter. D&D is not a physics simulator, as tends to get pointed out frequently here, with the additional caveat that they only do what they say they do.
The general rule is really that things like gravity work as expected regarding 'real world' situations, such as its affect on objects and creatures. But anything else, like spells, you just have to go by the rules.
Fireball says:
A bright streak flashes from your pointing finger to a point you
choose within range
Emphasis mine. You select the point. That's where the fireball blossoms. How the 'bright streak' moves to this point is irrelevant.
Other rules worth pointing out are the "Clear path to target", which has a tacit assumption that the path is a straight line.
And...regarding areas of effect:
For a sphere (like a fireball):
You select a sphere's point of origin, and the sphere extends outward
from that point
Again, pointing out the fact that you simply choose the point of origin.
And for a line:
A line extends from its point of origin in a straight path up to its
length
Here, the straight path is explicitly pointed out.