Hard to tell; I'd say that they're equally good in different ways. The first game was like the middle part of "2001: A Space Odyssey" with you playing Dave and GlaDOS playing HAL. I was only marginally funny, but it was gut-wrenchingly intense especially at the finale and stood up on its own as a serious sci-fi story.
Portal 2 is more like a spoof: a very well-done spoof, but a spoof nonetheless. Comparing it to the first game is almost like comparing "Star Wars" to "Spaceballs." As a serious sci-fi, it's just not as good, but from where I stand there has almost never been a game, ever, that has been funnier.