I can't speak for why SpaceX made the decision. However, while three legs won't wobble, four legs are less likely to tip over. SpaceX has demonstrated tipping over is a major problem.
Dr. Peterson of The Math Forum explains...
There are different kinds of stability! A three-legged stool is
guaranteed not to wobble because the ends of its legs always form
a plane. But a little wobble is only an inconvenience. More important
for practical purposes, [a three-legged] stool is LESS stable than one with more
legs in the sense that its center of gravity is further inside its
base: the more sides a regular polygon has, the greater its apothem
(the distance from the center to the middle of an edge). That greater
distance means the sitter can lean farther out in any direction
without tipping over. So if you don't mind a slight tipping but don't
want to fall on your face, or if you have a reasonably even floor,
more legs are better.
To do the math, imagine the circle made by the rocket legs is of radius 1 for simplicity. Three landing pads are on the vertices of an equilateral triangle. Four landing pads are on the vertices of a square.
Let's all pretend that's an equilateral triangle. The blue lines are the apothems. The green line is the radius. They form a triangle with an inner angle of 120/2 or 60 degrees. We can solve for the apothem using the law of sines.
$$\frac{a}{\sin 30} = \frac{1}{\sin 90}$$
$$a = \frac{1 * \sin 30}{\sin 90}$$
$$a = 0.5$$
And now four legs.
Same idea, but now the angle is 45 degrees.
$$\frac{a}{\sin 45} = \frac{1}{\sin 90}$$
$$a = \frac{1 * \sin 45}{\sin 90}$$
$$a = 0.707$$
At five legs, the apothem is 0.809. At six, it's 0.866. The basic formula is $\sin(90 - \frac{180}{n})$.
But what if we just used three longer legs? Would that be less weight than four shorter ones? In other words, we need to get the three-legged rocket's apothem to 0.707. How much further spread out do the landing pads have to be? Set a' to 0.707 and solve for
r`.
$$\frac{r}{\sin 90} = \frac{0.707}{\sin 30}$$
$$r = \frac{0.707 * \sin 90}{\sin 30}$$
$$r = 1.414$$
All three landing pads must be over 40% more spread out than four. For three legs, that's 120% further, and that's before we consider that the legs are at an angle and so need to be considerably longer to have the pads go 40% further out from the rocket's center. Being longer, they would need to be stronger and even heavier.
More legs provide rapidly diminishing returns. The general formula is simply $\frac{a2}{a1}$ or $\frac{\sin angle2}{\sin angle1}$.
- For three legs to match 4. $\frac{\sin 45}{\sin 30}$ or 1.414.
- For four legs to match 5. $\frac{\sin 54}{\sin 45}$ or 1.144
- For five legs to match 6. $\frac{\sin 60}{\sin 54}$ or 1.070
Four legs only need to be 15% broader to match the stability of five, or 60% total, making it more economical to use four longer, stronger legs than five shorter ones.