If you are coming to Barcelona for a limited amount of time, for example to teach English for the summer, take a three week Spanish course, or work on a project for a month or two, a good option to look into is a vacation rental.
Vacation rentals also work well if you are moving to the city and want a place to stay for the first few weeks or a month so you don’t have to hotel/hostel hop. If you want privacy, look for an entire home for rent, or if you’d like to pay less in addition to having access to a knowledgeable and helpful person to get you set up in the city, rent a room. Check out Homestay.com for room rentals. Guests save money and have a local guide available to them.
Of course, AirBnB is an option for room rentals, though Barcelona has closed tens of thousands of AirBnB rentals recently. They tend to be more expensive anyway. Other options are MisterBandB for gay friendly home and room rentals, and checking out Facebook marketplace for room rentals from locals who do not use agencies otherwise.
Agencies are always an option, though be prepared to pay high fees for their services.