Mr Trump endorsed Mr Moore despite a number of sexual harassment allegations against the former Alabama justice.
Ahead of the vote, the US president said Mr Moore "totally denied" the claims and told White House reporters they "have to listen to him, also".
The President boosted Mr Moore's campaign on Saturday, saying: “Get out and vote for Roy Moore. Do it. Do it. We cannot afford, the future of this country cannot afford to lose the seat."
Shortly before polls opened on Tuesday, he said "the people of Alabama will do the right thing" and vote for Mr Moore.
But, following Tuesday's Democrat victory in the conservative stronghold, the US President said he never thought Mr Moore could win.
"The reason I originally endorsed Luther Strange (and his numbers went up mightily), is that I said Roy Moore will not be able to win the General Election," the US President said in a Twitter post on Wednesday.
"I was right! Roy worked hard but the deck was stacked against him!"
Mr Trump first backed Luther Strange, a former Alabama attorney general, in the Republican primary race for the Senate.
At a September rally, however, he expressed doubts about his selection, saying "I'll be honest, I might have made a mistake."
He added: “If his opponent wins, I’m going to be here campaigning like hell for him.”
After Mr Moore defeated 64-year-old Mr Strange in the primary election, the US President fulfilled his promise and went on to give him his full backing.
Democrat Doug Jones claimed victory over Mr Moore on Tuesday, meaning Alabama has its first Democratic senator since 1992.
The win has nationwide consequences since it narrows the slim Republican majority in the Senate to 51-49.
Democrats are seeking to build on anti-Trump sentiment to mount a challenge next year to Republican control of Congress.
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies