its hard to gain muscle and lose fat at the same time. You can do it, but you won't gain a lot of muscle, and you won't lose a lot of fat. Think of each goal as being balanced on a scale. If you want to gain mass, you're going to sacrifice the rate of burning fat, and vice versa.
Having more muscle mass does cause you to burn more calories since you have to maintain that muscle.