It just seems weird to me that the devoutly Catholic Austrians were okay with her marrying someone like that. Not to mention the fact that Napoleon had invaded Vienna twice at that point. Was there a lot of opposition within Austria over this decision? Was there a lot of opposition within the Habsburg family? How about within the church itself?
Rather than being allowed to marry Napoleon, Marie Louise was offered as a potential bride for Napoleon by the Emperor of Austria, Francis I (the former Holy Roman Emperor and nephew of Marie Antoinette). I usually argue for looking more at personal motivations and the reality of religious faith in history, but in this case it's all about the realpolitik outweighing moral concerns. When it comes to international royal marriages, most concerns about religion and the like could be waived.
Napoleon was trying to build his own dynasty and his own familial network of power across Europe, using, at first, his own siblings, giving them royal titles and/or marrying them into royalty - but a second generation was needed to cement their status. He had considered divorcing Josephine a few times, because he needed children, which the couple were not producing, but - despite his and her infidelities - he loved her and didn't want to break from her. Still, in 1809 he told her that they were through, and she collapsed in tears and had to be carried to her room. While the pope would probably have not dissolved their marriage, what was left of the clergy in Paris granted him an annulment the next year. This is not a divorce, although historical annulments are often popularly thought of as divorces: an annulment means that the marriage retroactively never happened, and there is no barrier to remarrying and no cultural stigma attached to the couple. In their case, it was argued that the lack of witnesses to their wedding made it not legal.
To show Napoleon's status as emperor and make him seem as much like a legitimate French monarch as possible, he needed (and wanted) the kind of wife that an ancien régime French king would have - a foreign princess from another great power. There were two main options: Marie Louise of Habsburg-Lorraine, daughter of Francis I; and Grand Duchess Anna Pavlovna, sister of the Tsar and granddaughter of Catherine the Great. Napoleon leaned more toward the Russian princess, who could have solidifed an alliance between the two countries, but their mother - who had the final say over her marriage - hated him; when the offer of marriage was sent, the empress dowager asked for some time to think about it and Tsar Alexander stalled, which the French took as a refusal. So Napoleon withdrew his offer and turned to the Austrian court instead, which had already been well prepared and promptly accepted.
The Austrians had actually reached out to Napoleon in 1809 to make the offer first! From their perspective, their country was in a very weakened state in comparison to years past, and this marriage would make sure that France stayed on their side in the future. A queen/empress was also expected to act as an unofficial diplomat, and an Empress Marie Louise would have been able to advance Austrian interests even beyond the kind of cordial relations expected following such a marital alliance. (Marie Louise herself was not in favor of the match, as she had grown up hating and fearing Napoleon, and in 1810 was in love with another man of lower rank.) This did not work out, part of the parallels between the Marie Louise/Napoleon and Marie Antoinette/Louis marriages, and the separation from Russia would also prove to be disastrous in the long term, but it's easy to see how this would have been seen as beneficial in the moment.