"This wasn't an endorsement nor a political statement of any kind," McIlroy wrote.
"It was, quite simply, a round of golf. Golf was our common ground, nothing else. I've traveled all over the world and have been fortunate enough to befriend people from many different countries, beliefs and cultures. To be called a fascist and a bigot by some people because I spent some time in someone's company is just ridiculous."
The 19-year-old Ko, who will be playing at the Trump National course at the US Women's Open in July, also says golf is a common ground with Trump, with whom she met at the British Open in 2015.
Trump has also mentioned Lydia Ko in an interview before.
"On the Golf Channel, they said to her, 'When you bring the club up, how do you bring it down? What's your thought?' She said, 'I don't know. I don't really have a thought.' It's just something special," Trump said in a tangent.
"It was kinda cool to see how supportive he's been of the golf industry. I think at the end of the day, we're trying to play on some of the best golf courses," said Ko.