First of all, the First Lady is often the stand-in for the President at events like state funerals or weddings: then-First Lady Hillary Clinton attended Princess Diana's funeral instead of then-President Clinton. This is probably why Michelle Obama was invited to speak.