Why are planets tilted?

As far as I know, all celestial objects have a tilt to some degree. The Earth’s tilt for example is 23.5 degrees.
If our solar system developed from a swirling gas cloud, why would any of the planets have a tilt?
After you’ve answered that, try these -
Is there any theory to explain why planets vary in their tilt?
Does the moon have a tilt?

The swirling gas cloud was chunky, and not thin in comparison to the diameter of the protoplanets. A few 500 km diameter chunks impacting off the plane of a planets equator could easily alter the spin axis.

Isn’t it likely to be because they started from minor variations in the initial cloud and as they coalesced the various fragments hit the growing body at different angles and speeds? Each planet/moon/whatever got knocked about differently so they ended up where they are based on their unique history.

As the solar system formed, there were quite a few substantial bodies in orbit, more than there are now. Some of them collided from time to time, enough to knock a planet off its axis? I’m remembering this from a documentary a few years back on the BBC.

If the initial cloud were turbulent I don’t think collisions would be needed.

Yes, the Moon has an inclination of its equator to its orbit of 6.68 degrees.