Generally speaking, it's bad form to walk out in the middle of a fitness class. For one, you paid good money to attend, so ducking out early is a bit like setting money on fire. Also, the benefits of exercise only exist if you, you know, actually exercise.
And finally, it's just disruptive and rude. Everyone notices, including the instructor, which can throw them off their game. Don't be the jerk who screws with everyone else's workout for the sake of answering a phone call or chatting with a friend. Trust me, it can wait 'til the end of class.
There are a few situations, however, where walking out of a class is understandable, and in some cases, downright appropriate. Don't hesitate to get up and leave in any of the following circumstances.