How should I add a second level to a closet?
You would be able to mount a 2X6 ledger on 3 sides of the wall with 2 SDS screws in each stud, figuring it is wood framing at 16" on center. A 2X6 across the door and another across the center to break the span in the center and a piece of 3/4" plywood over it all ought to hold anything you choose.



2X4s would be strong enough but there is not enough mass around the screws and spacing between them in the 3 1/2" face to make it strong enough in my opinion. Use screws with joists hangers to hold the center 2X6. You could use 2X6s in the center 16" apart if you choose.