They do this because as they have not brought the book, they are idle and have no work to do so they interrupt others to have fun or time pass.
Carelessness or ignorance of the teacher could also lead to the situation.
They may not be interested in studying and not bringing books would have become a habit for them. They feel that if they are not studying , their classmates should not also study and get good marks.
To solve this, strict actions should be taken by the teacher for eg.- punishment should be given to those students who do no bring their books.
The classmates could also ignore the person so that they feel guilty and their habits may improve.