"To be called a fascist and a bigot by some people because I spent time in someone's company is just ridiculous," McIlroy, who lives much of the year in Florida, said on Twitter.
"... This wasn't an endorsement nor a political statement of any kind. It was quite simply a round of golf. Golf was our common ground, nothing else."
McIlroy, 27, said he respects the office of the president and pointed out that he does not agree with everything his friends and family say, but still plays golf with them.
"I hope to some degree this clarifies my decision to accept the invitation that was extended to me."
McIlroy's round with Trump came a week after South African Ernie Els played with the President and Japanese Prime Minister Shinzo Abe.
Professional golfers have long played with American presidents, but the issue has become more controversial as the country has become more polarized in recent decades.
Republican-leaning Australian Greg Norman once chided Jack Nicklaus for playing with then-President Bill Clinton in the early 1990s.
But Norman and Clinton later became friends and Clinton suffered a knee injury that required surgery when he stumbled on the steps outside Norman's home in 1997.
McIlroy, who has been injured, plans to return to competition next week at the WGC-Mexico Championship in Mexico City.
(Reporting by Andrew Both in Cary, North Carolina, editing by Gene Cherry)
