There are tons of gay-only hotels, guesthouses, and other accommodation all over Barcelona to cater to the active gay population. If you don't want it to be gay-only, you can stay at any hotel in Barcelona and they will all be gay-friendly. The culture is magnificent and locals don't just accept gay people, they celebrate them. There are also adult-only hotels for those looking for a little more privacy!
Barcelona is considered one of the central gay cities of the world. There are plenty of places to visit to experience the extensive gay nightlife that runs all night long. You can come to any of these bars to stop and stare at the eye candy all around, and chat a few of them up for a good time. There are also tons of sights to see listed in the link above, so make sure to explore all that Barcelona has to offer!