(Opinion follows)
The correct answer is probably that it is both, either, and neither, at the same time, it all depends.
If the link goes to something completely unrelated to the question/answer at hand, then obviously it is spam.
If the link goes to something that is related, but is linking to a commercial product, and was posted by someone related to the company that makes/sells said product, then it might be spam, then again it might not. It depends on whether the person actually could post a better answer without breaking some legal rules (like copyright, etc.)
If the link goes to something that answers the question, and is not spam, then it might be ok, but probably isn't.
Why "isn't"? Because of link rot.
If the answer can be re-posted on the site, even a verbatim copy from the linked reference, then that is a much better answer than a link to the answer.
Stack Overflow isn't a traffic source for personal blogs, and there are enough links on the site that has been left for dead for a long time, beyond the life of the page/site they refer to, effectively making these answers now a no-op.
However, if the source in question cannot be copied, for licensing/legal reasons, then it might be the only option.
However(2) If it was me, I would still distill the topic of that linked reference down to something that could be posted as a real answer, and then provide the link for further reference.
The real answer here is that you cannot make a catch-all rule that will handle all cases correctly.
Spam and abuse flags head right to the top of the queue so we can deal with real spam, harmful stuff such as viagra, manhood embiggening treatments and handbag ads.