I always went by the thought that it needed a lot of time to charge up its capacitors enough to blow away a whole planet. Also, even if they had destroyed Yavin first, it may have still been out of effective range of destroying the moon from over there.
The novel of Star Wars mentions that the Death Star gets to about six planetary diameters distance of Alderaan at the point they fire the superlaser. Going by the size of Earth, this would be about 50,000 miles, which is rather less than the distance from here to our moon. In the potentially much larger orbital system of a gas giant, it seems unlikely they'd be able to fire from the far side of Yavin and get the job done. Now it's probably safe to assume that this number was arbitrarily invented by Alan Dean Foster when he wrote the book, but the concept of effective range is valid regardless of the exact value.
For the second Death Star, not only could they recharge faster, but also it would require far less power to destroy a ship than an entire planet, enabling a much higher rate of fire at the Battle of Endor.