Michal, daughter of Shaul, was King David's first wife. However, after she later helped David escape from Shaul, Shaul gave her to Paltiel Ben Laish as a wife. The Talmud in Sanhedrin 19b has the account of how Paltiel, knowing that she was married to David, placed a sword between their beds and never consummated his marriage to her. When she was eventually taken back by David as his wife, Paltiel wept for the loss of his mitzvah of withholding himself from her.
כתיב פלטי וכתיב פלטיאל אמר ר' יוחנן פלטי שמו ולמה נקרא שמו פלטיאל שפלטו אל מן העבירה מה עשה נעץ חרב בינו לבינה אמר כל העוסק בדבר זה ידקר בחרב זה והכתיב (שמואל ב ג, טז) וילך אתה אישה שנעשה לה כאישה והכתיב (שמואל ב ג, טז) הלך ובכה על המצוה דאזיל מיניה
Was this really a mitzvah worth weeping over? Wasn't he in constant violation of the prohibition of secluding himself with a woman forbidden to him? Does the command of King Shaul to marry her justify this seclusion?