I am trying to make magnifying effect on an text. However, it is creating a double text like shown in the picture above.
actually the strange thing is that's how this effect works. it doubles your image. on all the tutorials I have seen there is a background merged with the element so there is not transparency therefore it does not matter. there are ways to make it work: Magnify effect creates double text? but I wouldn't make the effort, and just use the transform effect instead:
I would also in addition use the bulge effect to get a nice lens distortion
Magnify works on all the pixels in a layer and respects transparency so to make Magnify work properly on any layer with transparency you need to put something behind the transparency. Just throwing a solid behind your text layer and moving Magnify to an adjustment layer would solve the problem unless you need to maintain transparency. I'm assuming that you are rendering the comp with an alpha or nesting it in another comp that has a background. If it is in another comp then you can use the adjustment layer trick but if you need transparency behind your magnifying glass you'll have to use another effect. Roei has offered one possible solution. There are others. Depending on the look you want you might want to add an adjustment layer, create a circular mask, then add Spherize. If you are not moving the magnifying glass around the comp you could add a mask to the text layer that is the size of the Magnifying glass, add Sphereize (0r any other distortion effect you like except Magnify) and then use the compositing options to limit the effect to the inside of the mask.
There are a bunch of other ways to simulate a magnifying glass on a layer that has opacity.