"...did the Party really think that the man was a suitable candidate to represent them..."
Well, no they didn't. But the people of Alabama chose Roy Moore as their (Republican) candidate and then he refused to step down, trapping the Republican Party between a rock and a hard place. They couldn't force him to step down. They could only barely afford for him to lose. And at the moment US politics is so partisan that openly backing the Democrat candidate would be politically impossible.
Trump ended up backing Roy Moore to the hilt, and so that *does* link this victory somewhat to a rejection of his support. Funnily enough, this is now the second time Trump's preferred candidate has lost in Alabama this year -- he didn't back Roy Moore as candidate in the Primaries.
Still, at least -- unlike Moore, at least as I type this -- Trump has come out with a sensible and respectful tweet, congratulating the winner while promising to fight back in the next time Alabama's senate seat is up for election (2020 I think).