Koh Tao aka "the rock" is perhaps the most famous for cheap accommodation and dive courses in the region. You can get a bungalow 1-2 minutes walk away from Sairee Beach for $200/month. A/C, shorter rental terms, etc drive up the price, of course. Dive centers will often offer free room for the course duration. The diving itself is only OK due to crowded waters, but very safe.
Phuket is a more upmarket option in terms of entertainment etc, but it's quite urbanized, and the main boat pier is on the other side from the best beaches.
Panglao, Alona Beach in the Philippines offers better diving, a clean beach, and also very reasonable prices. Also takes long to get to, through Manila and Tagbilaran airport.
I'm sure there's a dozen other places. The best one depends on how long you have. If it's 2+ weeks, to do OW and AOW, and some fun diving, the above work well. Otherwise there are easier-to-reach places.