The difference between stables and lighthouses or granaries is this:
1) Granaries are always useful, they can ultimately provide at least one additional population (~2 with specialist policies), and can add to overall growth speed. This is true even if there is no wheat/spices/sugar around to make them somewhat better at it. Growth is always important for cities and allows the city to do other things than farm (use mines, build villages, use specialists). It provides strategic options as a result both for the AI and the player.
2) Lighthouses add a merchant slot and cost less upkeep than the other two. They're also limited by coastal cities, which not all of the AI's cities will be in most cases.
It can also add +2

from policies, usually not long after we'd have them built. Not all AIs would use the later function, but some will and all CAN use the merchant slot, even if not all will.
3) Stables have no specialist slot, add only +1 production if there's nothing around for a cost 2 upkeep (versus +2

on the granary) and are built everywhere by the AI. Literally everywhere. I could see building them if you're the Huns very early on regardless of city tiles, but that's about it.
I find I want at least two generic livestock tiles or at least one horse to build it. Limiting it to having livestock around would eliminate on some standard sized maps probably 10-15 otherwise useless stables that are just money sinks for the AI (depending on how much jungle there is).
By comparison, if it builds a barracks somewhere inefficient to raising armies, it still could add XP to any units, and still would add production and a specialist slot, for less upkeep. All the stable does along those lines is let it build a handful of strategic units somewhere slightly faster, it doesn't really need that function everywhere in a wide empire as it can only build so many mounted units in most cases. It is probably fine to have it not quite everywhere as a result. Only mostly dead if we could do it would be better.
A closer comparison to the stable is the hydro plant because of how both work by scanning for terrain and thus both really only add meaningful production per certain tiles. There are some cases you CAN build one, but since it might only add 1-3 raw production for a 3 upkeep cost, why bother? There again, it's limited by at least being on a river in the first place.