We sometimes get somewhat on-topic questions or on-question answers that contain a link that is completely unrelated to the question or blatantly shoehorned in. Please do not edit these questions to remove the link, but just flag them as spam (or if things are difficult to discern, raise a custom moderator flag).
The odds that somebody accidentally inserted such a link is astronomically low. For example, a lot of things must go simultaneously wrong such that somebody is truly impressed by the design of a site offering dubious path-clipping services and asks a question on how to reproduce certain aspects of it. We have to accept that we cannot completely eliminate the risk of nuking an honest post by a new user.
Even if the post is on-topic, it is rarely valuable. First, there is an inherent high chance of the content being plagiarised. Second, the questions should usually be closed, and the answers are not really helpful. In the rare event that such a post is actually useful and clearly not plagiarised, we can still copy the content (with attribution) in a new post.
The target audience of spammers is not users of this site, but search engines who will rate their site higher the more connected it is. If we edit out the link, it will still be in the history, and the spammer still has achieved their goal. We truly want to avoid this, since it may encourage the spammer to repeat the strategy.
Also see: Should spam posts be edited?