Cruz is going to run for president, this is a good move to put him on the world stage. Remember, 99% of the earth believes Mandela is an angel so if Cruz disses this funeral, it will be used against him later.
Worrying about “the world” is what gets US presidents into trouble. The imperative is to worry about God, not Satan’s world.
Also, if he runs for president, this move (attending the funeral) might just sway a few African Americans to consider voting for him. Maybe.