Pride has been identified as part of the seven deadly sins, and one may not be wrong if he sees it as a vice that one should avoid in all entirety.
The morality of an act depends on the approach. For example, violence is morally unacceptable in society, but can violence against injustice be termed wrong? ( Violence I referred to is this aspect doesn't necessarily involve physical destruction, it can be being outspoken, using all possible weapons to fight injustice without causing physical destruction)
Pride is a feeling of deep pleasure or satisfaction derived from one's achievements, the achievements of those with whom one is closely associated, or from qualities or possessions that are widely admired.
Source
When is Pride Ideal?
Looking at the above definition, it is obvious that one who is proud of his accomplishment is not in any way sinning. Statistics have also shown that those who are proud of what they are doing normally succeed. You will agree with me that pride in the above situation is a weapon that will help such a person fight off negativity from those who may want to discourage him in his endeavors.
Again, in spiritual growth, one who is proud of his qualities, attributes, and God barely gives in to discouragement during hard times. When you check most successful leaders, you will discover that pride is not absent in their life. It is what keeps them going, and helps them stand by their decision to achieve a particular goal.
Pride to an extent encourages perfection, excellence, and competence. These are virtues that are essential for success.
When is Pride sinful?
When one is so proud of himself that other people's opinions are insignificant. This level of pride is deadly and can destroy one easily because it makes the person susceptible to errors.
Pride is sinful when it prevents you from taking correction. Such a person barely succeeds because he is not open to learning. He continues in his errors and thus remains stagnant.
One who out of pride refuses to share his challenges with others is not only guilt of the sin of pride but also exposes himself to the dangers of depression.