As much fun as I've had playing, I still have to say that the AI for this game is neither good nor well thought out, especially when it comes to diplomacy. But you do have a couple of misconceptions in your post.
Alliances require close relations, the next step after friendly.
Race attitudes are what each individual race feels about the other, not a combined relationship ranking. It's easy for a race to like another race that hates them, just as one person can like another person who doesn't like them.
Don't be so free with your techs unless you get something in return, because the AI races will not return the favor. Ever.
You're best off if you consider every game to be you against every other race, because that's the way it's going to be. You have to pay for help from them, and their attitudes towards you, and each other, changes constantly. That holds true even in campaigns where races are supposed to be on the same team as you. The AI isn't designed well enough to understand the concept of ally or teammate.
Others will disagree with me on this, but I've found it much easier to deal with evil races than with good or neutral ones. The evil ones are not only more predictable, but they usually have low diplomacy skills so you can get more out of them at lower costs. But again, remember that you're on your own. The AI races are not your friends. The only things alliances are good for is an alliance victory and getting you into wars you don't want to fight.