Everyone knows it is not to your advantage to let the leader get even further. The AI is quite stupid in that regard.
Even if it sees another player having 8 points and 4 unused development cards, it would still sometimes steal from someone who has 6 points and no development cards. Or even worse, trade with the leader if no-one else is willing to trade.
Also the AI has no foresight when someone would be trying to steal its' longest road or largest army. Even if it has the means to immediately strengthen the position.
Also trying to do the best for you "at that moment" is sometimes not best for the whole game. In that regard the AI is so much worse than the regular human player that it is not funny anymore. You can not take the AI games seriously anymore.
And this is why AI should NEVER interfere in a game where only humans are playing. But that is completely another story.