Depends what you're playing.
If you're playing casual or a pub you'll be better off playing a class that the team needs, but if you're playing competitively whether it be UGC or just competitive mode then you'd probably be better off having a main within the meta.
That being said, having a main isn't really frowned upon. If you know a class and play it very well then odds are nobody will have a problem. Ever see one of those engies in comp that manages to carry an entire team, or one of those spies who manages to axe off the entire enemy team? I don't really think anybody has an issue with those guys.