There is no single best hunter pet — the answer changes with your talent specialisation, because each tree rewards a different pet ability.
Both bring high health and strong armour, which suits a Beast Mastery hunter's philosophy of letting the pet hold aggro and take the beating. The trade-off is damage: a tanky pet keeps you alive but takes considerably longer to bring a target down, so fights drag. Good for survivability, poor for pace.
Spiders bring a webbing ability that roots or slows the target. That is exactly what a Marksmanship hunter wants, because the whole tree is built around standing still and landing aimed shots. Pin the target, step back, and the cooldown-based burst becomes far more reliable than it would be against something that keeps closing the distance.
Raptors provide a damage-over-time ability, and Survival is the tree that leans hardest on damage over time — the specialisation is effectively built around stacking those effects. A raptor's contribution feeds directly into the spec's core mechanic rather than sitting alongside it.
Match the pet's ability to the thing your spec is already trying to do. A pet that duplicates your strengths is worth more than one with marginally better raw stats, and this is why pet advice from one era or one spec so often seems wrong when applied to another.