Even if Li Shimin likes Wu Meiniang again, as the king of a country, even if he dies, he will think of his own country. He will also believe in Li's previous divination, and he doesn't want to die because of it in order to protect the land of Datang. So before he died, he gave Li a testament to save him. If Wu Meiniang is pregnant after his death, both men and women should be eliminated.
This testamentary edict is also a major reason why Wu Meiniang became Wu Zetian. When I saw this testamentary edict in Wu Meiniang and learned the truth, I was very sad. I thought Li Shimin didn't love himself, so I began to degenerate and finally embarked on the road of emperor.