Obviously the cost will be the driving factor for lower budget films, but it is far more puzzling with big buck blockbusters. And it happens in the other direction as well. IIRC Glasgow and/ or Edinburgh have recently served as New York, Gotham, Metropolis and whatnot for various flicks. At least Canada is a short hop from the US. When you are filming a $200m blockbuster, what percentage of the budget is saved by switching the production to the UK?
We watched The Flash the other day, and it is blatant the few outdoor scenes it contained were filmed in a British city masquerading as the US. To the studio's credit, at least it looked a bit more credible than the Austin Powers-like level of quality seen in many other films.