A student who does not complete his math assignment is told he can not participate in gym is not a logical consequence. Staying after school to complete his math is a logical consequence. A logical consequence for a student who cannot follow the rules of a game in the gym is to have the student sit on the sidelines and watch the game. Having everyone miss gym because a couple of students won't follow instructions on forming a line to go to gym is not a logical consequence. Having the students who won't line up properly sit out part of the gym class may be a logical consequence. It will be a logical consequence if they like gym, it won't be a logical consequence if they hate gym.
Logical consequences is an excellent strategy to use, so long as the consequences are respectful, and logical. The consequence must be directly related to the disrespectful behavior. Making connections between math and gym, in a student's mind, doesn't seem to work. What it does is create, in the mind of the student, how "unfair" the teacher is.
Logical consequences seems to have an "upper level" of effectiveness. It doesn't seem to be real effective with students who have major behavioral problems. Some studies have suggested that students who have major behavioral problems are not curable. They suggest designating major behavioral problems (such as instant rage, with violent behavior) as a chronic disease. They have followed students into adulthood and have not seen changes in the behavior of the people they studied. With these types of students other strategies are more effective, such as Team Planning, counseling, etc.
There is a difference between punishment and a logical consequence. Punishment involves pain. Put in jail is punishment, the pain is being isolated from society, etc. A consequence is used to teach someone that there are better alternatives to choose from.
Some actions can not result in a logical consequence. Swearing at a teacher requires a set of agreed upon consequences which could include seeing the principal, phoning home, detention, etc.
The bottom line in using consequences is that the consequence must be respectful to the person receiving it. Giving a consequence that is not respectful does not teach the person to be respectful. Sometimes, before a consequence is given, other strategies must be tried.