Whether or not the real estate company is allowed to keep your deposit for the section 8 rental if the property failed inspection by the Housing Authority depends upon what is stated in the lease agreement. As such, you need to carefully read it in that its terms and conditions control the obligations owed to you by the landlord and vice versa in the absence of conflicitng state law.In similar situations that I have dealt with, if the property fails section 8 Housing Authority approval for rental, the landlord and/or his agent is obligated to return the tenant's deposit for the unit immediately if the tenant advises that he or she will not occupy the unit.Good luck.