This behavior does seem a little unexpected, but the result shown does match
what summarize would show for r(sum) after a weighted summarize command --
the weights are not normalized so the result is inflated by the mean of the
weight . One work-around is to divide the weight by it's mean (either by
transforming the variable or just calculating it's mean)...for example:
sum weight
scalar meanw=r(mean)
tabstat foreign [aw=weight/meanw], stat(sum)
Usually, though, this weighting adjustment is automatically done for you
with aweights, isn't it? What is the logic for not doing the adjustment
with the tabstat sum? There may well be a good reason, but I have no idea
what it is.