DC's behavior makes sense, from DC's perspective. That government wants to have as much strict gun control as possible, and their actions are precisely the way to get it. They play offense, and make the other side force them to change.
They probably know their law is going to be overturned, but they don't care. That law is on the books right now, being enforced, and it will remain until their opposition (us) eventually manage to get it overturned. Once it does get overturned, they start over again from the beginning, with a new law that fails to satisfy the court's ruling.