The figures below show a Lorentz transformation in 1+1 dimensions, depicted as a distortion of the original coordinate grid (gray square) to a new one (parallelogram). Time is the vertical axis and space horizontal.
In figure 1, the clock is at rest in the original frame of reference, and it measures a time interval $t$ of four ticks. A clock at rest in the new frame of reference ticks four times during a time interval that the observer in the original frame describes as $\gamma t$.
In figure 2, the ruler is moving in the first frame, represented by the square, but at rest in the second one, the parallelogram. Each picture of the ruler is a snapshot taken at a certain moment as judged according to the second frame's notion of simultaneity. An observer in the first frame judges the ruler's length instead according to that frame's definition of simultaneity, i.e., using points that are lined up horizontally on the graph. The ruler appears shorter in the frame in which it is moving.
The Lorentz transformation treats in 1+1 dimensions treats space and time in a perfectly symmetric way, but this should not be taken as implying that special relativity perfectly embodies such a symmetry. For example, I can easily revisit a place that I’ve been to before, but I can’t go back in time. And of course we have three dimensions of space; our use of 1+1 dimensions rather than 3+1 is just a matter of convenience for the moment.
There is no close analogy between figure 1, where the clock is a pointlike object tracing a line through spacetime, and figure 2, where the ruler is an extended body that sweeps out a parallel-sided ribbon. So the analogy
time:time dilation::space:length contraction
is simply false. To make the analogy valid, we would have to replace the ruler with a pointlike object whose world-line was spacelike -- a tachyon.
There is actually a pretty straightforward argument that if time dilation is a factor of $\gamma$, then lengths must contract by $1/\gamma$. Suppose we have already convinced ourselves about how time dilation works. Now let Alice stay on earth while her twin Betty heads off in a spaceship for Tau Ceti, a nearby star. Tau Ceti is 12 light-years away, so even though Betty travels at 87% of the speed of light, it will take her a long time to get there: 14 years, according to Alice.
Betty experiences time dilation. At this speed, her $\gamma$ is 2.0, so that the voyage will only seem to her to last 7 years. But there is perfect symmetry between Alice's and Betty's frames of reference, so Betty agrees with Alice on their relative speed. Betty sees herself as being at rest, while the sun and Tau Ceti both move backward at 87% of the speed of light. How, then, can she observe Tau Ceti to get to her in only 7 years, when it should take 14 years to travel 12 light-years at this speed?
We need to take into account length contraction. Betty sees the distance between the sun and Tau Ceti to be shrunk by a factor of 2. The same thing occurs for Alice, who observes Betty and her spaceship to be foreshortened.
I have a longer presentation of this material in ch. 1 of my special relativity book, which is free online.