Hows' you gonna lock them casters when you are in the bed?
This unit looks too tall to be comfortable to work at. A tilting work surface with a ledge at the bottom would hold you books and paper at a more convenient angle than dead flat... just my opinion.
The Vari-desk concept that has and adjustable height flat working surface is interesting for this unit. A front hinged panel that can either be tilted or lay flat would also work. DO NOT water the plants while laying in the bed.
It's a good lookin' table/work surface in my opinion, very contemporary. I wouldn't add end caps. I would want a back rail, however. There will be a lot of torque on the joints, unless the casters roll easily, but that creates the issue that it rolls too easily. The larger the wheels, the easier it will roll. You might look into a bicycle hand brake type of wheel lock, OR wheel chair wheel locks. You may not need them at all, so I'd try it without first.
If you pull the bed away from the wall the thickness of the table it could store at the head of the bed. The space could be used for bedding storage and whatever. This would make changing the bedding easier and would clean up the overall look, when the table is not in use.
Nylon sliding gliding furniture pads would work, rather than wheels. If you didn't want to have the bedding hang down real far, you could make rials that attach to the bed rails that the unit slides on, and eliminate the wheels, casters or pads. This would increase the expense however. I'm just spit ballin' ideas out for Ya.
My mom and I shared many an apartment when we were poor and I was in my teens, so I understand your situation. I slept in the top bunk in one apartment where there was only one bedroom. I never knew any different, so it wasn't an issue. Now, my bedroom, closets and bath is as large as the entire apartment was. I had a bed up on 4 x 4 posts with a table saw, drill press and welding tanks underneath in one apartment. I had to change my own bedding in that unit.