This is a good example of why you should treat interviews as a two way street. Don't just worry about convincing them that you are the right candidate. You should also try to determine if they are the right employer.
I view unsuccessful interviews as a way to see some city I wouldn't have otherwise visited and more importantly get experience with current job interview styles. It takes time, but it's not a total waste. Though, some companies make it hard or take very long to get travel reimbursement.
Easy enough to say if you're a developer and can afford to be choosy. For most fields, though, the labor market is heavily biased in favor of the employer.