World Wide Words had the answer:
It has been an all-purpose term of disapproval among young people in the UK during the middle to late nineties. It first turned up in print in 1994, in pieces that indicate it was popularised by DJs on the BBC’s radio pop channel, Radio 1... But there’s evidence that the word in this sense is somewhat older, and that it comes from student slang.You learn something every day.
Pants in British usage are not trousers, of course, but underpants, principally male. These intimate nether garments have long been a source of innocent merriment among pubescent youth, and this was just another example, in the tradition of the earlier exclamation knickers!, indicating contempt or exasperation. It appears in phrases like “it’s a pile of pants!” (Simon Mayo’s catchphrase) and “it’s pants!” or “it’s absolute pants”, meaning that it’s a total load of rubbish. Later, we began to hear it from older people as in “My tomato crop was pants last year”. In phrases like “say pants to ...” it’s an injunction to wave goodbye to something considered outmoded, unwanted or unnecessary.