Earwigs are drawn to moisture. Unfortunately, the bathroom is probably the one room in the house with the most moisture. Is it a second story bathroom? What is below it? Do you have any leaks around the foundation of the home, a sprinkler system, excessive water puddling outside? These types of things will make your home very attractive to earwigs and other bugs. Some good practices to get in the habit of doing in order to prevent this attraction in the bathroom would be making sure the exhaust fan is on while showering, wipe sinks and tub/sills down and keep them as dry as you can, use drain stoppers to plug the drains while not using, fix any leaks under sinks or around toilet. Also think about what might be on the other side of the walls. If it's a first floor bathroom, are there plants right outside that room touching the house? Do you have mulch in your flower beds that is right up on the house? Raking that mulch back 2-3 inches from the foundation and trimming any foliage will do wonders to reduce insect populations.
Besides these measures to cure the problem at its source, a thorough exterior/interior pest control application will reduce populations of all unwanted insects. If you hire a local professional to do this for you, it will most likely be a one-time treatment and they'll use a product that will last the next three months, keeping you covered against pests like that into the Fall. There are products you can find at home improvement stores, but to be honest, they're not the best. And without the knowledge of where you're applying the product, it may not be very successful in controlling your target pest. :)