The Rambam (Mishneh Torah, Hilkhos Shemitah 13:12) famously rules that members of the tribe of Levi do not fight in the army. In the next passage, he adds that anyone who wants to serve God fulltime is similarly exempt from army service.
However, the Torah states in this week's portion, regarding the war against Midian (Num. 31:4): "One thousand from each tribe, one thousand from each tribe, for all of the tribes of Israel, you shall send into the army." On this, Rashi quotes the Sifrei (link):
For all of the tribes of Israel. This includes the tribe of Levi.But why were Levites ordered to go to battle if they are exempt from army service? R. Yitzchak Sorotzkin, in his Rinas Yitzchak (ad loc.), suggests that Rashi disagrees with the above Rambam. The Rambam holds that Levites are exempt from all army service in any kind of war while Rashi holds that Levites must fight in an obligatory war and are only exempt from a permissible, but not mandatory, war.