One of the primary purposes of corticosteroids is to suppress immune activity and inflammation: that's exactly why they are used in asthma.
Of course the immune system has an actual job besides causing nuisance inflammation: fighting infection.
For some infections, the harm to the infected person caused by the immune reaction itself is worse than that of the pathogen itself, so steroids can help prevent damage or ease symptoms while the immune system continues to mount a response, without being hyperactive.
For others, immune suppression may be detrimental.
Corticosteroids mediate the immune response by suppressing a variety of cytokines and increasing others, which influences activity circulating numbers of different immune cell populations. Cortisol binds the glucocorticoid receptor, causing numerous changes in gene expression, many of which are associated with the immune system. From Wikipedia:
(cortisol) inhibits production of interleukin (IL)-12, interferon (IFN)-gamma, IFN-alpha, and tumor-necrosis-factor (TNF)-alpha by antigen-presenting cells (APCs) and T helper (Th)1 cells, but upregulates IL-4, IL-10, and IL-13 by Th2 cells. This results in a shift toward a Th2 immune response rather than general immunosuppression. The activation of the stress system (and resulting increase in cortisol and Th2 shift) seen during an infection is believed to be a protective mechanism which prevents an over-activation of the inflammatory response.
In other words, corticosteroids work by by suppressing the generalized killing/cleanup part of the immune system mediated by macrophages and CD8+ cells, while preserving the B-cell part of the immune system that produces specific antibodies and the neutrophils that phagocytose antibody- and complement-bound pathogens.
Immune reactions are incredibly complex, so some of these basics may be violated in certain circumstances (including prolonged rather than acute dosing), and I've left out a lot of the other related immune cells. See references below (and the Wikipedia pages linked above) for more:
Cupps, T. R., & Fauci, A. S. (1982). Corticosteroid‐mediated immunoregulation in man. Immunological reviews, 65(1), 133-155.
McGee, S., & Hirschmann, J. (2008). Use of corticosteroids in treating infectious diseases. Archives of internal medicine, 168(10), 1034-1046.