It only intuitively makes sense -- there are quite a few assumptions. The local product is typically more expensive because it's production is less efficient (if it wasn't, it would just compete with the non-local product at regular market conditions). Being less efficient means using more inputs per output, so what is the local farmers inputs, and -- crucially -- where are those inputs made? Is he using his not-locally-made tractor less efficiently? Is he paying a mortgage to a non-local financial institution? Is he sourcing his feed, seeds, fertilizer, fuel etc locally? And of his profit, how much of it is he spending locally?
These are difficult numbers to work out exactly, but it's not difficult to see that they have to be in a pretty thigh range for your local-premium to actually, on the net, drain resources from the community, compared to you just eating cheaper meals a bit more frequently. The main type of input that most obviously support the local community is labor, and most modern products, particularly agriculturally, are rather light on labor, so you might end up supporting one job at the farm in favor of three jobs at the diner. Especially if the farm-job is held by a "highly educated, ex-urban, first-time farmer" and the diner-jobs by single moms, it's getting morally quite dubious.
But to wrap this up, local to non-local is rarely apples to apples. Just as with organic, there's probably a very substantial overlap with meeting a demand for products that are simply better (and thus more expensive), with the nominal quality (local, organic) actually being secondary.