They don't need to be the same Ideology. At least, it doesn't complain if you assign teams across ideologies. I haven't seen them attack each other. I haven't seen them particularly support each other, either. In an MP game, being in a team means you get to see each other's map and you can do diplomacy any time, not much more.
Along w/ what erischild stated, they do, however, when on teams tend to declare war on you as a group versus one at a time. But, when you declare war they don't join in.