Jehoshaphat was a good king and not just a run of the mill good king, but perhaps the best king in Judah after David, excepting only Hezekiah and Josiah. Jehoshaphat's father had started purging Judah of idolatry and other wickedness and Jehoshaphat finished the job. He didn't just re-institute the proper worship of God and call on all Judah to follow Him, Jehoshaphat also sent out missionaries with copies of the Law all through Judah and had the Law read to all the people so that everyone would know of their responsibilities towards God.
Several times in his life he was out of his depth and cast all his hopes upon God and trusted Him to take care of things. His faith was astounding, his zeal for the Law was great, and his commitment to following God was almost unparalleled among post-Davidic Judean kings.
Yet for some reason this paragon of righteousness decided to make peace with Ahab the king of Israel. A more wicked king than Ahab would be hard to find. (Manasseh perhaps?) In fact, 1 Kings 21:25-26 says: "But there was none like unto Ahab, who did sell himself to do that which was evil in the sight of Jehovah, whom Jezebel his wife stirred up. And he did very abominably in following idols, according to all that the Amorites did, whom Jehovah cast out before the children of Israel."
As was the case with most treaties back then, the one between Jehoshaphat and Ahab involved a marriage between the royal families. Jehoshaphat married his son Joram to Ahab's daughter, Athaliah. Joram had to have been very young, in fact not much older than 14 at the time of this marriage. The consequences of Jehoshaphat's decision to bind himself to the wicked Ahab were nothing short of disastrous, though he himself didn't live to see it. 2 Kings 8:16-11:3 and 2 Chron. 21-22 detail what happens:
1) Joram, being influenced by his wicked wife, becomes an idolater and rebuilds the idols and high places his father had torn down and led the people back away from God and into idolatry.
2) Joram murders all his brothers, who Elijah calls more righteous than he, to eliminate competition for the throne.
3) As punishment, all but one of Joram's sons are killed by marauding Arabians and Philistines and Joram is stricken with one of the most revolting diseases described in the Bible. He dies.
4) His youngest, and only remaining son, Ahaziah becomes king and is counseled by his wicked mother. He, too, is wicked and joins with Ahab's son Joram (confused yet?) to fight the Syrians. When Joram (Ahaziah's uncle, by the way) is injured, Ahaziah goes to check on him just as Jehu begins his God-ordered cleansing of Israel. He is caught in the rebellion and is killed along with Joram.
5) Other Judean royal kinsmen traveling to Israel to succor the injured king Joram are also caught by Jehu and executed as partisans.
6) Finally, Athaliah kills all of Ahaziah's children (except one who was hidden from her) and usurps the throne. She murdered her own grandchildren in a power grab!
Look what has happened to the house of David! For three consecutive generations every royal son save one was killed! Add to that 42 extra men who were royal kinsmen not of the direct line killed by Jehu and you have a serious pruning of the descendants of David. All that murder and death, all that idolatry, all that work by Jehoshaphat undone because he tried to make friends with an wicked man.
This made me think of 2 Cor. 6:14: "Be not unequally yoked with unbelievers: for what fellowship have righteousness and iniquity? Or what communion has light with darkness?" Paul continues like this for several verses before quoting Isaiah 52:11: "Come you out from among them and be you separate says the Lord, and touch no unclean thing and I will receive you." Who have I yoked myself to that might have the same type of impact on me that Ahab had on Jehoshaphat?
We need to be careful who our friends are. We need to be careful who we "hang" with. They WILL have an impact on our spirituality. They WILL bring temptations our way.
Now, of course, Paul also said in 1 Cor. 5 that we aren't to withdraw from the world completely. Jesus told the Pharisees that as the spiritual doctor, he needed to be among the sinners who needed his help. However, if you read the Gospels, you will notice that while Jesus ate with publicans and prostitutes, those were isolated evenings on an occasional basis. He spent far more time with his apostles and other disciples. Much of that time he was alone with them. So, while Jesus spent time with the wicked in an effort to teach and save them, the people he yoked himself to were his apostles. That is the example we need to follow as we try to save our neighbors and acquaintances in the world. Shine your light among them, but prefer spending time with your brethren.
We need to be very, very careful who we join ourselves to, who we yoke ourselves to, or the consequences that befell Jehoshaphat's family might befall ours.