It's pretty simple.
Either she wrote it and was too stupid to know that she would get caught. Or other people wrote it (who were too stupid to know they would get caught or were trying to intentionally sabotage the trump campaign) and the speech was total bullshit that she had no true connection to.
Yes all politicians and their family have speech writers, but the idea is that they should work to articulate the earnest feelings of the speech giver. Not just insert a bunch of platitudes.
I bet Michelle Obama wrote her own damn speech actually. Both of them are amazing writers.