Part of what you're saying is right: it's rational to cooperate to achieve goals.
However, you're wrong in 2 ways:
1. Group identification is not a necessary component of cooperation. I can vote to support gay rights without being gay. I can vote to support gun freedom without owning a gun. You're using the vague word "align" to mean both identifying as part of a group and cooperating, but these are not the same thing.
2. Your post is only looking at cooperating toward goals that arise from shared identification as part of a group. This is a myopic view: there are lots of people who despite identifying as part of the same groups, have different, incompatible goals. This is exactly why not identifying as part of a group is rational: if you identify as part of a group, then you will have the human impulse to take actions that achieve the goals of the group, even if those goals are incompatible with your own goals.
For example: I find myself cooperating with a certain political party more often than not--I've fairly consistently voted for them, and even worked for some of their political campaigns. But I don't identify as part of that party. This means that when someone criticizes that political party, I'm not offended: they're not criticizing me, because I don't identify as part of that party. I don't take it personally. And it also means that when I disagree with that political party, I don't fall prey to the Granfalloon technique. If I disagree with them (and I do) I don't feel any pressure to conform my views to the political party. I can rationally support my own goals, not theirs.