If it is a new song that isn't out yet, and no one had had the ability to hear it, then I agree that's a very strange and unsatisfying closer.
If it is simply a new song on a band's latest album, I am all for that. I'm a big fan of sprinkling new songs into all portions of a setlist, particularly the closer if it has some sort of message you want to resonate.
The problem with U2's approach in this case is that if no one has had a chance to hear the song or read the lyrics yet, even if it was something that they wanted to resonate, many probably left not getting the message.
If a band really feels compelled to leave the audience with a taste of something that is unreleased yet, there are other ways. I remember Queensryche was playing the song "Hostage" over the PA at the end of shows in 2005 (after the encore and they had left the stage) as a preview for Mindcrime II which was coming in 2006. It was very well received (ironically, it was actually meant for their previous record, it was just reworked for Mindcrime II) and left people with a lot of anticipation for Mindcrime II (the song was a bit different on the album, but the differences probably didn't resonate with casual fans not familiar with the tune's history).