An extension to that question: Why do people say elevating your heart rate is good in relation to exercise, and bad in relation to cocaine? People frequently say things like "stimulants stress your circulatory system", but so does exercise.
Not a professional, but the way I reason it is that pushing your heart to the limit causes it to grow stronger, and that additional capacity means it doesn't have to work as hard during the rest of the day. You basically bring down your average heart rate by making your heart stronger.
Just because the heart rate is elevated in both cases, that doesn't mean the context is the same. It's not the same cause, it's not the same result.
Exercise raising the heart rate is a consequence, that (the increased heart rate) is not the singular magic thing improving your health. With exercise there's a positive, body-comprehensive event going on.
Exercise strengthens the heart.
Cocaine (for example) damages the heart. It doesn't just elevate the heart rate, it does some vicious things to the heart, causing damage:
Caffeine raises your heart rate for a short(ish) time, but at least for moderate amounts of consumption that doesn't seem to have any negative effects. There are even some studies that suggest that one or two cups of coffee a day may have health benefits, including the cardiovascular system.
Cocaine on the other hand seems to raise your resting heart rate because it damages your cardiovascular system [1]. Your heart has to work more to achieve the same result, the opposite from what you want to achieve with exercise.