It's one thing to marginalise them, it's another to actively destroy the legacies of the characters. Which these films did so intentionally. I don't know what to believe about reports of Kathleen and her merry band of feminists who hated Luke. However, it seems pretty clear the intention of the trilogy was to remake Star Wars to be around Rey. Which could only be achieved by tearing down characters such as Luke.
We live in the era of, "Wouldn't it be great to remake *insert successful film* but this time to lead is a woman." This is entirely what Lucasfilm and Disney were doing but they didn't do it with a straight remake, they did it in sequels, altering the existing characters legacies, tearing them down and transferring everything to Rey.
Rey now has the Millenium Falcon, Chewie by her side, she's a Jedi and has the legacy Luke was meant to have had. She has even been given the iconic Skywalker name. The goal was to transfer the pop culture icon of Luke Skywalker to Rey Skywalker, remake Star Wars to be around her.
Now, there's nothing wrong with a female lead in the sequels, it's this destruction of the original lead done in order to prop her up. She's even given a more important and evil relative to show how much more important she is. She's the one who actually now defeats the bad guy of the original trilogies.
I think this also explains how unoriginal almost everything in the sequels is. It's a remake pretending to be a sequel. Almost nothing is original in these films. It's just a remake intended to rebuild the Star Wars franchise to be around a female character. If it wasn't, they'd have had an original story, not be tearing down the enduring legacies of existing characters, transferring icon aspects of original trilogy characters onto the new one.