While Saul had no heart for God, and his son David had a heart fully after God, we see that Solomon had a divided heart.  He loved God, but he also loved a lot of other things.  This kind of division got him into a bit of trouble, and through his story we gain an understanding of how a divided heart leads to a "less than" life.