So, with your example: Player A gets injured. You put him on the DL. You sign Player B to a 1 year deal that puts your guaranteed contracts over the cap. THIS IS WHERE THE VIOLATION TAKES PLACE. You now have guaranted contracts totalling more than the salary cap -- which is against the rules.The league has two options. We can either allow you to keep Player B until Player A is healthy giving you the benefit of breaking the rule or we can require Player B to be cut immediately making you have to deal with the consequences of violating the league rules. Since we don't want a rule-breaker to benefit from his actions, we go with the second option.
Further clarification:
In the example above, what if signing Player B raises my total salary to $70,000,000 and Player C on my team has a 0 year contract for $3,000,000. Did I violate the rule?
No. The only problem is if your guaranteed contracts go over the cap. When Player A gets healthy, you will have to release Player C, since that is the only way you can abide by both the DL stashing rule and the guaranteed contracts rule.
What if it's the same situation as above, but Player A is my only 0 year contract?
In the case where cutting Player A is the only way to abide by the rules, you simply have to cut him.
What if I sign Player B to a 1 year deal, but I intend to trade him to another team for a 0 year guy while Player A is still injured. Did I still violate the rule?
Yes. You violated the rule at the moment you signed the Player B to a deal that put your guaranteed contracts over the salary cap. Allowing you to maneuver your way out still gives you the benefit of violating the rule.