I just looked on Farnell and the cheapest solenoids that I could find in stock have a weird housing (and they're £6.38 each which is already more than Amazon), the cheapest sensible ones that are in stock are £12 each, which is way more expensive than Amazon, plus you have to pay VAT and postage on top, plus you have to faff around with their enterprisey order form, compared to one or two clicks on Amazon.
Because of reliability, etc.
For the same reason you wouldn't order your ingredients for a professional Michelin starred restaurant from Amazon.
I've almost never found Amazon cheaper either. The sellers on Amazon are almost always not the original manufacturer, they're usually FOB folks who are just buying big boxes of things and then selling them individually.
You're almost always better served to swim upstream and get things from the manufacturer, or from reputable electronics distributors like digikey, Farnell, mouser, jameco,etc. A quick search at some of those and I'm finding suitable solenoids at $2-5
The products on mouser and digikey are from reputable industrial component manufacturers. They have warranties and datasheets, support from the mfg, traceability and trustability, etc.
They're simply different products. You can't compare a quality made product from a quality supplier and manufacturer to cheap crap you buy on amazon