All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Abiding by public laws that regulate the lives of the people and which do not clash with the Commandment of the Law Maker (i.e. Allah), and there is a public interest in them, or violating them leads to an apparent public disadvantage, is an obligation and the person is sinful by violating them (these laws).
However, not all the laws clash with the Sharee’ah. It could be that it is something that is permitted by the Sharee’ah, such as the cutting of trees, hunting, and practicing trade for anyone who wishes to do so in permissible matters.
However, the ruler may prevent some of it, or limits it for a public benefit, or in order to repel a public disadvantage, so his (ruler’s) act does not contradict the Sharee’ah.
So it cannot be said that the Sharee’ah allowed it and he forbade it, because the Sharee’ah permitted him to prohibit it or to restrict what is permissible in order to bring a benefit or repel a disadvantage (harm); so it is an obligation to abide by that in general. This is included in the rule: The ruler restricts what is permissible.
As for the issue that you have mentioned about the copying of books and programs, it is not the same case because this is one of the Sharee’ah issues on which the scholars differed in opinion.
Some are of the view that it is forbidden because intellectual rights are special rights for their owners. In contemporary customs, these rights have a significant financial value as people give them great financial value, and these rights are Islamically considerable, so it is not permissible to transgress them.
Some Fiqh Councils as well as considerable Fatwa Committees are of this view.
Some other scholars are of the view that if one needs to copy copyrighted material due to the inexistence of the original copy, or that he cannot afford to purchase it, then he may copy it for his personal use (benefit) only, provided that he does not take this as a means of earning or trading.
Ibn Uthaymeen said about copying CDs:
"In my view, if a person copies them for his own personal use, then there is no harm, but if he copies them in order to trade with them (to sell them), then this is not permissible as there is harm on others in this case." [End of quote]
If a person imitates this view, according to the Fatwa issued to him as being the preponderant opinion in his view, then he is not sinful –Allah willing. However, it is better in order to be on the safe side to avoid this.
Allah knows best.