This is the result of two physical facts: that gravity, pointing toward the center of the Earth, is the only way to define "down", and that most of the Solar System is quite close to a single geometric plane, the ecliptic, which sort of is like the rectangle you describe. It's also partly because most of our communications are essentially two-dimensional, so depicting the actual three-dimensional nature of space is rather difficult.
The first of those physical facts is pretty straightforward. Because "down" is always toward the Earth's center, to go anywhere away from the Earth we have to go "up". That's really all there is to it. (Although, in practice, most spacecraft have to achieve orbit before leaving Earth's vicinity, and orbit is moving sideways at very high speeds while falling, such that the inertia of that high speed counters the acceleration of falling. So while spacecraft do need to go up, they also need to go sideways comparatively much faster until they're quite far out from Earth: tens if not hundreds of thousands of kilometers.)
The second of these is a bit more involved. The orbit of a body always lies in a single plane (discounting the various perturbing effects that can shift it slightly), so if the Sun had a single planet and nothing else it would, by definition, be a system with the "long rectangle" effect you describe. But in fact our actual Solar System is very close to being that same "long rectangle", despite the numerous bodies in it: the planets orbit within just a few degrees of the same plane, called the ecliptic (which is defined as the plane that the Earth orbits in), and many of their moons aren't much farther off.
Since it's so close to the truth most of the time to depict a trajectory from "above" the ecliptic without worrying about it going a little up or down, and since it's so much more difficult to print or display a full three-dimensional orbital track, most publications simplify it the way you've seen. But the actual inclination of orbits does need to be tracked for interplanetary probes, of course, any of which would miss essentially any target by millions of kilometers if not more if they simply assumed everything was in the ecliptic.
In the case of interstellar missions, things get more complicated. Stars aren't distributed very tidily in relation to the ecliptic. However, practical interstellar exploration, if we ever have the technology to do it, will still follow a single plane for most of the mission, or as close as makes no matter, and since the distance between stars is vastly larger than the entire Solar System, diagrams can just represent it as a dot on one side of the page and show a nice tidy long slightly curved line to a dot on the other side. The actual trajectory from Earth might look like a series of turns around the Earth and Sun before a slowly straightening path off toward the destination, but you can understand why the groundside view is not very practical to put in a single picture — you can't see the spacecraft most of the time, and when you can, you can't really see what it's doing.
If we ever get to the point of scheduling multiple star system stops in different Sun-relative inclinations in the same trip, then things will finally need to be represented more accurately as a routine. But that's so far in the unforeseeable future there's no real point worrying about it.
It's fair to mention, though, that the Voyager spacecraft in particular have rather high inclinations at present; they used their last gravity assists (from Saturn and Neptune respectively) to shoot off at a fairly sharp angle of 36° and 79° respectively relative to the ecliptic. Prior to that their inclinations varied within the normal few degrees of the ecliptic. Accurately showing the Voyager 1/2 trajectory from 9.5 AU (Saturn) or 30 AU (Neptune) to their current position (which, at least in Voyager 1's case, is well over 100 AU from the Sun) would still mostly focus on the post-ecliptic phase, but there's enough beforehand that a good diagram might really need to work on showing the transition three-dimensionally.