Prayer is a stream of energetic thought-vibration. In praying exclusively for ourselves we are obviously being self-oriented, but people need to receive personal guidance and refreshment for their souls, and sometimes to feel a sense of being unconditionally cared for by some Greater Power.
These needs can be fulfilled by ‘touching base’, so to speak - to pray for yourself is not morally ‘wrong’.
Our prayers for other people are undoubtedly helpful, but it’s productive to seek peace and progress for ourselves, too.
Egotistical prayers do not usually evoke favourable responses from evolved Beings in eternity; whereas prayers sent out for the good of others and for the advancement of one’s own spiritual nature will naturally draw, through the Law of Attraction, the help that seekers have earned by their behaviour, thoughts and feelings.