Other answers cover very well why we need a transitivity axiom in the case of axiomatised Peano arithmetic.
But it's worth considering: why does this not feel necessary for the equality relation? The following idea may underly your intuition.
In many logics, we have an additional rule of 'substitution' or 'substitutivity'. Sometimes it's considered an axiom, sometimes a rule part of the logic, and sometimes an axiom schema (for example sometimes in First Order Logic, in which the second order axiom given below can not be written). Read about it here on Wikipedia.
It looks something like this:
For all variables $x$ and $y$ and for all formulae $P$, if we know $x = y$ and we know $P(x)$ then we know $P(y)$.
One way to write it as a second order statement is this:
$\forall P. \forall x. \forall y. x = y \implies P(x) \implies P(y)$.
Interestingly, once we have this axiom, logical rule, or axiom schema in place, all that is required to derive the other properties of equality is Reflexivity.
The derivation of Symmetry relies on the observation that an application of the substitution rule with $P$ as $w \mapsto w = x$ gives us
$\forall x. \forall y. x = y \implies x = x \implies y = x$.
The derivation of Transitivity relies on observation that an application of the substitution rule with $P$ as $w \mapsto w = z$ gives us
$\forall x. \forall y. x = y \implies x = z \implies y = z$.