Per dictionary.com, "law" is defined as:
- the principles and regulations established in a community by some authority and applicable to its people, whether in the form of legislation or of custom and policies recognized and enforced by judicial decision.
- any written or positive rule or collection of rules prescribed under the authority of the state or nation, as by the people in its constitution. Compare bylaw, statute law.
- the controlling influence of such rules; the condition of society brought about by their observance:
maintaining law and order.
- a system or collection of such rules.
The difference between "a law" and "law" in this case is that between a specific piece of legislation/statute and law in the general sense of something mandated by a government.
The original phrase, "while our own compulsory school attendance became law...", seems to indicate that compulsory school attendance became legally required (without mentioning a specific piece of legislation that made it so).
Another way to read the original sentence is, "while our own compulsory school attendance became legally required..." Another way of reading the altered sentence (using "a law"), is, "while our own compulsory school attendance was required in a specific law".