As long as you practice yoga or pilates simply as exercise and nothing more, it is not a sin. I have done yoga for years and recently started pilates. They are wonderful for your body. Some people may get into a spiritual meditation (mainly in yoga) during some of the exercises at the end of a workout, but you certainly don’t have to. If you attend a class where they do this, you can use this time to pray, but mostly they are just trying to get you to focus on your body and how it feels so that you are more aware of it. By aware, I mean how your body feels during and after the workout. This helps you retain better posture and symmetry throughout the day (which is good for your spine).