Is it perhaps that the higher resolution of the 40D is showing up the imperfections of the lens that may always have been there? Are you getting the softness throughout all aperture settings? I'm not surprised that the Canon 70-300 is a sharper lens than the Tamron one, but of course I don't know how much a difference we are talking about here.
If you are sure the lens really is faulty then perhaps try contacting Tamron and see what they recommend (and see if they'll perhaps do you a deal

)