transimpedance amplifier based on a capacitive feedback current amplifier
The cascode stage is there as a transconductance to convert the voltage output from the gain stage to a current that can be directed to the current steering network (that you have omitted from your diagram) to achieve gain control.
The differential cascode stage is convenient in that it has the other leg for use as the actual output for the circuit.
Your second circuit is not really the same as it uses a voltage output stage. M2 is just there as a buffer.
Note that where capacitative feedback is used some means of ensuring stable bias must be present. In the first circuit there are resistors (that you have not shown) that do this.