Let me put it in another way, imagine we find clay in an asteroid. Does that alone imply the existence of ceramic in other places of the universe?
We need these molecules to build build a DNA strand, but their existence doesn't imply the existence of other life forms. Maybe exists a process that produce these molecules naturally and we just don't know about yet.
And remember that life(self replicating organisms) is way more complex than just DNA/RNA. In another crude analogy you could say that DNA is just the source code, to have life you still need to have all the hardware to run this code on. (fun fact: that is the reason why people argue about virus being something alive or not. Generally it has only the RNA necessary for the replication, and this is why it can only reproduce if it is able to take over another cell. In this analogy it has the source code but not the hardware, so how do we classify it?)