We usually have unconsious reasons for doing things. Comparing yourself and your life to other peoples' for example, is probably a habit of ours as we think we can assess ourselves or how well we are doing. It is how we are used to gauging how good or bad we are, or how good or bad our life is.
But when the mind is so interested in what other people are doing, beyond merely a learning tool, when it becomes personal, all about “me” vs “them”, then it can become counter-productive. It can make you feel worse, and it takes attention away from your own source of energy and authenticity, and into a realm of thinking where the image of yourself is still not good enough.
It also blinds you from appreciating all the good in your life, which is the foundation for anything more.
Energy for anything flows from within. If the attention is locked outwards, overly interested in other people and how their life compares to yours, then you remove your attention from resting in your own power. Of course you can learn from others, be inspired by others, uplifted by others, but when you begin to compare, you can easily get lost in a world of thinking that isn't even real, it is very subjective, unstable, and not really even true.
It all depends on how much the comparisons make you feel empowered. If you feel as if comparing yourself to someone else makes you a better, stronger version, then of course it makes sense to do it. Or does the comparison make you feel smaller, weaker, more unworthy or just unhappy?
Let go of what does not empower you, and see what difference it makes.