This is because spider jockeys do not take into account the hitbox of its rider
Related issues
is duplicated by
relates to
Attachments
Comments

[media][media]

this might be intentional?
Can confirm in 20w49a. Feel free to use this command to reproduce the issue:
/summon spider ~ ~ ~ {Passengers:[{id:skeleton}]}
Can confirm in 21w06a.

Affects 1.17
Can confirm in 1.19.
Can confirm in 1.19.2.