And just in case you have no rule book handy, here is a link:
Official Rules | MLB.com: Official info
To further clarify, I believe that you are not understanding that even though the runner was tagged out, it was on a
force situation, due to the batter becoming a base runner. The runner from first was forced to advance, so his tag falls under the definition of a force for purposes to determine a run scoring.
If, OTOH, the runner had
not been forced to advance, such as the batter-runner trying to stretch a single into a double and was tagged, then the run would count if it preceded the tag.