How do I apply the same texture to the bathroom wall after patching a hole?
The short answer is to repaint the entire wall. When patching, its almost impossible to get a perfect match of texture and color. If the patch is small you might never notice it, but large patches are usually noticeable to some degree.  This might be just because the original paint has cured for a few years (probably yellowed too), or it could be like your case with different textures.

It does however sound like the patch might not have been sanded well enough, so the first step is to sand the patch back down so the surface is smooth and even with the wall.  The prime the spot, and repaint.  If the original wall was painted with a roller, make sure to use a roller again.  A patch that is painted with a brush will usually stand out on a wall that was painted with a roller originally.