The last good colab that U2 did was probably I'm Not Your Baby or something (The Troubles doesn't count). Everything they've done since Pop has been with some supposed "hip" artist like Wyclef Jean, Green Day, or Missy Elliot, but they were all pretty lame.
It's so obviously pandering.
I agree with your view on U2 and collaborations. I'm not a big fan of their collaborations with BB King, Mary J. Blige, Jay Z, or the others you mentioned (though I do like "The Saints are Coming"). I think the reason I'm not a huge supporter of "The Troubles" was the fact that it was a collaboration and upended a fantastic "side B" to Songs of Innocence (I can take or leave "side A"). Besides Green Day, maybe the only collaboration they did that I dug was with Johnny Cash.
I could more easily see a U2/rap collaboration with, say, Kayne West (I cringed when there were the rumors Bono was going to be on his last album). Or even Drake, when they are all buddying around backstage a year or so ago.
But I disagree with you about pandering, in this case. Kendrick Lamar isn't a bubblegum pop star. He's got an edge to him. It's hard to imagine what this could possibly sound like. Are U2 appearing on this album as part of their never-ending and detrimental quest for "relevancy?" I'm not naïve enough to think that's not a part of it. However, I'm inclined to believe what's going on here will be something heavy, either politically or spiritually (or both, at the same time). And I don't think Kendrick Lamar would let something limp and lame that reeks of rock stars in a freefalling midlife crisis on his album.
At first blush, I was worried of U2 embarrassing themselves, like your divorced dad buying a convertible and cruising for women half his age. But knowing what I know about Kendrick Lamar and thinking about it further, I don't think this will be the case.
*caveat: coincidentally, I accidentally heard the Kendrick Lamar/Maroon 5 song on the radio last night in the car and temporarily thought about driving myself into the ditch to stop the noise.
**disclaimer: Vox and the subsidiaries of Vox reserve the right to say he was horribly and unequivocally wrong whence Good Friday arrives.