For some reason teachers who ordinarily are comfortable with managing students in their class, find the management of students within a computer area such as a computer lab, extremely demanding. One response to this is that teachers ask for technical staff to block websites citing that the sites are a distraction.
Here is a good response to this issue http://tiny.cc/nTk10.
Within my experience I would say that one of the reasons for students being distracted when in class is due to the trivial and/or unengaging nature of the work that students are set. The cure for this is differentiated learning and the use of powerful questioning techniques. A good reference for this is www.fno.org