Since the Czech Republic's probationary days as an EU state (we're talking the very early 2000's here), the Prague Airport has been the site of numerous pilot tests sponsored by the EU. As a result, the airport has developed a favourable infrastructure for pilot tests.
A pilot test can be anything from a variation on the procedures or more often the introduction of proposed equipment/technology.
Further, the end-user demographics vis-a-vis airport size make it a great locale for training, and the airport hosts border guard trainees from other member states (as does Poland and various other EU members).
However departing passengers are always checked by immigration,
although they don't stamp passports. And I've seen the same
configuration in other Schengen terminals, so I know it's not a
Prague-only issue.
It's not necessarily always... A given pilot test can run anywhere from a month up to 24 months and during that time the eagle-eyed traveller would expect to see slight variations.
What's the rationale behind this? Note that I'm not asking about why
airlines check IDs on Schengen flights, just why immigration is doing
this.
It's seemingly against the Freedom of Movement Directive to do this, but there are carve outs for the purposes I have described. As you pass through the control point you may notice variations in their uniforms (green shirts, blue shirts, and white shirts) along with differing insignia on their epaulets indicating if there are 'guest' border guards. And a closer look at the equipment they are using will give an indication of a piece of technology that the EU is considering.
Finally, there are currently 7 member states who have used Article 23 of the Borders Code to implement temporary border controls inside of the EU so far this year. They are Belgium, Denmark, Norway, Sweden, France, Germany, and Austria. The Czech Republic is not on this list (at the moment) so you would not expect to see special measures in effect for that reason.
Adding: personal note, I'm one of those people when the border officials are doing something unusual who says "why are you people doing this?". I have never done it in Prague, but do it lots of times entering/exiting the UK (or Russia or the US or etc). Sometimes you get incredibly helpful info, and sometimes you don't.