Can I Remove One Side of Wall for Shelves
I do not see any specific problems with embedding a shelf as you propose. Particularly due to the fact that the other side of the wall faces into a bedroom closet. Places where this may not be a good idea are:


An exterior wall where the the embedded shelf would interfere with having insulation in the wall.
Locating the embedded shelf in a high moisture area adjacent to a shower.
If installation of the shelf requires removing any moisture resistant wall covering including vapor barrier, cement board or tiles.


In fact many bathroom medicine cabinets are simply a shelving unit that is installed between two studs.

It is possible to build an embedded shelving unit in such way that you trim it out nicely so that the actual studs and back side of the adjacent drywall are all covered. This could include using a piece of appropriate thin sheet material to cover the drywall. Here is a nice example: