Answer:
Napoleon wanted a male heir to his throne so he divorced Josephine since she can't give her any children, let alone a son.
Explanation:
The marriage of Napoleon and Josephine was a match of love. But after a few years of marriage, it was pretty much evident that she wasn't able to conceive. So, even though he still loved her, he began to look for someone else who has the possibility of providing him an heir. And Josephine also agreed to the divorce even though she also still loved him for she also want him to have an heir.
Napoleon then married Marie-Louise in the hopes of getting an heir and also validating his empire. Thus, by marrying her, he was also eventually taken in by the German imperial royal family, as Marie-Louise was the Archduchess of Austria. And with her, they got a son who later succeeded him briefly as Napoleon II.