Don't even THINK of using MDF, painted or not.
I know people, including myself, that have used plywood. Yes it's cheap but that's what you get out of it too. It's funny how people will avoid a single knot in a solid board but be OK with glued & baked plywood. Plywood will be much heavier and less durable an any solid board. Humidity and moisture beat the hell out of plywood and hives can be very moist on the inside. Plywood will have gaps and voids that reduce insulation and harbor SHB and ants, where solid wood will not. If you want to use plywood for a honey super it will last you a while. As a brood box you my end up very unimpressed compared to solid boards with a knot or two.
What's wrong with glue? Two inch decking screws are much better than staples though. These boxes take a beating during their lifetime. Build them a tough as you can. Unless you don't mind always replacing boxes.