There is no place for an ego at a poker table. It can be argued that it's helpful away from the table but at the table it's only detrimental.
One of the biggest mistakes I see players make is playing in games with better players because they can't or don't want to admit to themselves that a game is too tough. This includes staying at tables where bad players leave and are replaced by good players. It also includes knowingly playing in tougher games to prove to themselves or others they can beat those players or that limit. I see this often with heads up players. A good player will sit with someone they can't admit is better than them and lose all of their money. Poker is about winning money, it's not about saying, "I beat so and so" or being able to say "I crushed the 300-600 game for x amount of $'s". If it is about that, poker will humble you*
*Phil Hellmuth excluded
I find I play my best poker when my ego has absolutely nothing to do with my thought process at the tables. It's at these times that poker is strictly about making decisions which will yield the highest expected return for me. This applies to in-hand decisions as well as game selection decisions. When playing, I'm constantly juggling tables, swapping better tables in and bad tables out - this is a big part of my overall success. I'm also leaving tables if there are no fish sitting at them, regardless of whether I think I'm the best player left at the table or not. In addition to avoiding better heads up players than me, I also avoid players I think I have a small to medium edge over. There are enough bad heads up players at my limits that playing even average players is not efficient use of my time or mental energy.
I find I play my worst poker when I let my ego interfere with my thought process. For example, player X has raised my big blind sixteen straight times. My ego says, "Doesn't he know who I am, I've won more money then he'll ever win." Instead of focusing on what I should be doing to counter his strategy, I'm letting my ego and emotions get the best of me. Another example, a 3rd player sits down to my immediate left when I'm playing somebody heads up. My ego says, "Why does this guy keep sitting at my heads up games, doesn't he know sitting with me in a 3-handed game is a losing proposition. And why does he always have to sit on my left?" Instead I should be refocusing my thought processes and strategy for 3-handed play. After all, someone will sit at my table eventually and there will always be somebody acting after me regardless of where they sit.
Losing your ego at a poker table is a huge obstacle out of the way. You can focus solely on playing poker and making the best decisions.