The phrase “you’re inflicting pains on others at the expense of your own selfish reasons” can be improved for clarity and grammatical correctness. A clearer way to phrase it might be: “You’re inflicting pain on others for your own selfish reasons.”
In this context, the phrase means that someone is causing suffering or distress to other people in order to achieve their personal goals or desires, which are motivated by selfishness.