Answer: This is an excellent question-and the answer varies depending on which market in which you are working. Generally speaking, when making hiring decisions, law firms around the country frown upon candidates who have "jumped the law firm track" and pursued government (or in-house) work. Given the general lock-step nature of both salaries and experience in big firms, these kinds of moves are often considered disruptive and, to some employers, demonstrate a lack of commitment to law firm life. That said, Washington, DC is a market where a move to the government may be permissible, if not beneficial-but only for specific agencies.
There are a few firms in the DC area that actually appreciate government experience and where going back and forth between agencies and the firm is common. Specifically speaking, experience at the SEC and the DOJ are often valued by large firm employers. There are a couple of reasons for this. First, firms appreciate the solid, hands-on litigation and trial experience that attorneys gain in these agencies. They know that this experience is typically far more substantive than anything they would receive in a law firm. Additionally, firms know that they have the potential to benefit from the numerous relationships that are cultivated inside these agencies. Securities litigators who secure positions at the SEC seem to be at a particular advantage in this matter. In some cases, law firms either request or require SEC experience as a condition of employment.
Making a move to other federal agencies can be somewhat trickier as the experience may not be as valued by law firm employers. There are some instances where experience at the Department of Commerce is valued for International Trade attorneys. However, generally speaking, attorneys should think long and hard about any move to a government position, specifically whether the transition fits into their long-term career goals.