The example shader is opaque and does not support transparency without modification. The alpha value it outputs is correct, but the shader's render type, queue, ZWrite, and blend modes are all the defaults, which are for an opaque shader. You'll need to change those to make the shader transparent, and use premultipled blend mode.
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
ZWrite Off
Blend One SrcAlpha