“the last thing we need” means something you not want or avoid, however, occasionally it means oppositely the thing finally necessary.
Example: In an article of the Independent (Independent, Jan 4, 2016) introductory paragraph says ‘Rochdale is a town used to making the headlines for the wrong reasons. So the last thing it needs as it tries to rebuild its reputation is another sex scandal.’ and in three paragraphs later it says —”Rochdale already has a bad name,” said Donna Pearson, 28, a mother-of-three who was shopping in Yorkshire Street. “It needs improving and bringing back up. This is the last thing we need.” Obviously these two “the last thing it needs” mean totally opposed as far as I perceive, confusing me as a non-native English speaker. So, could someone advise me about how they can be distinguished? Or should it be distinguished only in context?