So what you wanted to do was to use alpha of one texture as alpha of another, basically you wanted to mask second texture. Just for future reference.
Your code is very poorly optimized for such a simple task, I would like to recommend:
float4 PixelShaderFunction (float4 position : SV_Position, float4 color : COLOR0, float2 coords : TEXCOORD0) : COLOR0
//sample alpha from first texture
float mask = tex2D (Sampler0, coords).a;
//sample rgb and alpha from second
float4 rainbow_color = tex2D (Sampler1 , coords);
//multiply alpha channels, only pixels that are visible on both should remain visible AND operation
rainbow_color.a *= mask;
This would also preserve antialiasing from original text if there would be any.