Hard to say what kind of worm it is from the pic. However, there are lots of different worms that show up. But with the exception of just a few species, most are scavengers of some kind. I would just leave them be myself.
With respect to you're algae issues try using
steel straws to siphon algae off the rocks and sand and
paper towels to remove it from the glass. To clean sand you've siphoned out you can soak it in H2O2 for a day or so, rinse well in tap water, I let it dry for few days, then return it to your tank.
I may be wrong but I have the impression you used dry rock and bacteria cultures to set up your system. You might find these links helpful in understanding your systems complexities better.
Studying the effects of live rock in a newly established aquarium shows that high-quality live rock promotes the rapid establishment of an effective biological filter and a microbial community similar to those found in mature reef tanks.
www.reef2reef.com
"Coral Reefs in the Microbial Seas" This video compliments Rohwer's book of the same title (Paper back is ~$20, Kindle is ~$10), both deal with the conflicting roles of the different types of DOC in reef ecosystems. While there is overlap bewteen his book and the video both have information not covered by the other and together give a broader view of the complex relationships found in reef ecosystems
Changing Seas - Mysterious Microbes
Microbial view of Coral Decline
Nitrogen cycling in hte coral holobiont
BActeria and Sponges
Maintenance of Coral Reef Health (refferences at the end)
Optical Feedback Loop in Colorful Coral Bleaching
DNA Sequencing and the Reef Tank Microbiome
Richard Ross What's up with phosphate"
15 Answers