You misunderstand, like a retard, because you don't known what you're talking about.
Prisons are massive compounds, cities unto themselves. They have their own medical, dental, radiology, electricians, plumbers, construction, and yes, fire fighting. Why pay people $80k a year to do those jobs when you can make inmates do it AND they learn valuable marketable skills in the process, which reduces recidivism rates? If you're facing massive wildfires and you happen to have thousands of inmate firefighters sitting around why would you not use them? That is extremely irresponsible.
They aren't "first line of defense" they are "scraping the bottom of the barrel."