A government is a system by which the community is being organised and run. According to one tradition in political philosophy, we have a government because it is necessary to prevent us from harming each other and as such to enable us to live together as a community.
The philosopher Thomas Hobbes held that in a state of nature, it is a ‘war of every man against every man’. As such, the need for ‘self-preservation’ would lead to each person doing whatever it takes to keep himself alive. If there is no authority to govern society, it would lead to a situation of ‘continuall feare, and danger of violent death’.
Each person is constantly ready to fight for his own life and for his basic needs. To avoid this situation, it seems more prudent to agree to a social contract, where a government creates a set of rules or laws by which to live by and where individuals agree and hence are duty-bound, to not harm each other. This is to get the result that everyone can survive.
The government needs to provide its citizens with security and justice and more, or they won’t get approval or consent from its citizens. Although the citizens give up their rights to self-preservation and hence must obey the laws, they can oppose the government and break a law if they think that the law is wrong.
In other words, civil disobedience ought to be justified if the people disagree with the laws of the state. For example, it is justified to be a homosexual and to perform homosexual acts if the people disagree with the anti-homosexual laws of the country. People can disagree with the laws on grounds that it does not harm anyone and that it is a private matter that the state has no reason to intervene in.
The question is to what extent people’s reasons are legitimate enough to oppose a law. It is not legitimate to oppose a law, for instance, just because one doesn’t feel like following a law. I decide to throw rubbish on the ground as I like, because I feel like it, but that does not make it right to oppose the law that we cannot throw rubbish anywhere we like in public spaces.