Because Missoula [1] is a real crossroads, a great number and variety of lodgings are available. Unless there’s a big football game, graduation, or some other major event going on at the university, you’ll have little trouble finding something.
There are many inexpensive and somewhat marginal motels [2] along Broadway near downtown Missoula; be forewarned that many of these can be the sites of weekend parties.
Also, no matter where you stay, bring earplugs; trains do run through town.
Links:
[1] http://www.moon.com/destinations/montana/missoula-and-northwestern-montana/missoula
[2] http://www.moon.com/destinations/montana/missoula-and-northwestern-montana/missoula/accommodations/under-50