In PIX i used single step debugging one of the two pixels with the artifacts and it showed me that my if-condition is met and it reads from the texture the correct value and then also executes the else-block writing the pink to the color. What the hell?
That's normal. Generally branches are implemented by executing both branches and lerping the results. This is because several pixels are processed in parallel, and they all need to run in lock-step and execute the same code.
You can explicitly specify dynamic branching by using the branch attribute like MikeBMcL said (and you can't use tex2D, ddx or ddy intrinsics inside the branch)
As for your artifact, it looks like you're using XNA or DX9? If so, are you taking into account the half texel offsetwhen sampling from your texture? Forgetting to do that is often the cause of artifacts along triangle edges.