Why are some government services/programs closed from the federal government shutdown, while others aren't? For example, why does Congress get paid, while FDA inspectors are furloughed? And why are some agencies still running and others aren't?
There is a law in place that was passed that does not allow Congress to pass any legislation that would change their own pay.
It is, in fact, the 27th Amendment to the US Constitution
No law varying the compensation for the services of the Senators and Representatives shall take effect, until an election of Representatives shall have intervened.
Any changes in pay can only take effect for the next Congressional session. The idea being that it would be more ethical to not try to immediately enrich oneself, and changes could potentially benefit someone else if they were to retire or lose in the next election cycle. Also, if the people were properly outraged by self-indulgent compensation measures, they could take it out on the Congressperson and boot them before they could ever benefit from such an action.
Seeing a loophole to be exploited between the loose language of the law and the clear intent, when it came time to shut down the government, furlough workers, and stop checks from being issued, they got a convenient legal ruling that said, yes, suspending their own pay is considered altering the pay of Congress (because the law didn't just say pay raises) during the same session, therefore, it is illegal for them not to collect their paychecks during a shutdown.
Our tax dollars, hard at work.....
In the United States governance there are different types of government programs. As DA. pointed out when the government closes some functions of Congress dependent funding are deemed so important that they must remained open going unpaid for the time being. These are called emergency personnel and are considered essential to the function of America. All government employees may only be paid for the time they work or went without labor after the government reopens and Congress declares them worth of pay for time served. Others departments and employees like the President, Supreme Court and Congress need not be considered emergency personnel because the funding for their jobs does not depend on individual acts of Congress any longer; it has been written into permanent law.