According to the bible and Christianity, some of his wives worshiped idols. When he became old, he forgot about god and made sacrifices to idols. So of course, God became angry with him.
source:
1 Kings 11:1–3
"When Solomon was old, he forgot God. His wives wanted him to worship their idols. Solomon did the wrong thing. He made sacrifices to the idols. God was angry at him."