There are two reasons:
- He was never in the line of succession.
At no point during the series is Tywin ever in a position to inherit. The throne was initially held by the Targaryen line until Robert took it, after which it was held by the Baratheon line. By all accounts, Westeros follows the same basic kind of inheritance laws as medieval Europe, meaning that the line of succession passes through the King's family, but never into the Queen's.
- He preferred to be the "power behind the throne".
Succession laws aside, there were likely opportunities for Tywin to claim the throne if he really wanted it. His position during Robert's Rebellion probably gave him the opportunity, as did his military power during the War of the Five Kings (especially after Joffrey's death).
However, it seems pretty clear from his actions that he doesn't want to be king. He wants someone on the throne that he can control -- ideally his grandchildren, if he can help it. But even when Robert and Aerys were on the throne, Tywin's military and economic influence meant they could not afford to ignore him and his family. He was even a key reason why Robert's Rebellion succeeded in the first place.
At one point, I believe he even makes this point directly to Joffrey: Joffrey's job is to be the King. Tywin's job is to keep him there. By sitting back and guiding the King's action indirectly, Tywin can maintain his position regardless of who is in power, while not having to deal with any of the problems that come with the position itself.