What so many people fail to realize is that, unlike most nations, our chief executive and head of state roles are combined in one person, the President. In parliamentary systems, there is usually a ceremonial head of state (king, queen, elected or appointed president) and an elected prime minister. In most countries, the ceremonial head of state would attend a function like this and say the pretty, diplomatic words suitable for such an occasion.
When a president of the United States attends such a function, he does so in his role as ceremonial head of state, not chief executive, nor commander in chief, nor head of the Republican Party.