What you call "costs" actually are salaries/jobs for people living there -- unlike fees paid to MS.
A government saves money if it pays €x to employ local taxpayers instead of sending that same amount abroad. It will still break even on the decision if it employs locals for €x+n, where n is the amount they recoup in tax from those locals. Even more if those locals would otherwise be unemployed.