In the US, all IFR aircraft need a clearance to be in class A, B, C, D, and E airspace. Does this mean that all aircraft with clearances need to be assigned squawk codes by ATC when they enter?
Yes. Every aircraft needs to be assigne a discrete code to allow radar systems to correlate flight plan data with the radar target and to enable identification using SSR.
The only exemption are aircraft which use Mode S, those can be assigned squawk 1000 and this leads to a correlation of flight plan data using the callsign transmited by the transponder instead of the squawk itself.