Although anti gun rights laws are often associated with Democratic or liberal politicians, the idea of gun rights actually fit in with liberal values.

Racial Equality
Liberals place a particular emphasis on racial equality.  Anti gun rights laws originated as a means of keeping recently freed slaves from being able to defend themselves or challenge their continued status as 2nd class citizens.  Today, gun control laws predominantly affect law abiding citizens living in urban areas, which means there is a disproportionate effect upon racial minorities.  Other gun bans target public housing, with a similarly disproportionate effect.  Worst of all, gun bans prevent racial violence victims from defending themselves against their often armed attackers.

Gender Equality
Liberals also place an emphasis on gender equality.  Gun rights go hand in hand with this struggle, while gun control serves to disproportionately disadvantage women.  That is because, as a matter of biology and/or cultural norms, women generally tend to be less physically strong then men.  That means that even if gun bans worked (which they don’t), an unarmed woman can usually be overpowered by an unarmed man.  An armed woman, however, is able to defend herself against a stalker breaking into her bedroom, or home invaders while pregnant.  Furthermore, many women (such as my girlfriend) are more sensitive to recoil then most men.  That means that handgun bans and “assault weapon” bans which take away the ability of law abiding women to have a lower recoiling gun for self defense will disproportionately affect such women.

Respect for those in the political minority
Liberal ideology also demands respect for political minorities.  For example, gay individuals make up a very small percentage of the population, yet liberal ideology states that the heterosexual majority should not try to legislate away the rights of the homosexual minority.  Similarly, gun owners are a political minority in many areas, with gun ownership rates somewhere near 1/3 of all households.  Rather than respecting this gun owning minority’s right to have guns for self defense in their homes, some areas have allowed a slim voter margin to take away everyone’s gun rights.  It runs contrary to liberal values to allow a majority to ride roughshod over the constitutional rights of a minority.

Equality between elected officials and the citizens
Liberals also rally against governmental corruption, and politicians who hold themselves to a different standard than their citizens.  However some of the most anti gun liberal politicians are protected by armed bodyguards at taxpayer expense, while their citizens are forbidden to have guns for self defense.  These same politicians will craft special gun amnesty provisions for themselves, while their unarmed citizens are being murdered at an increasing rate.  Other politicians will focus on their own personal security to the detriment of their (unarmed) neighbors and other citizens.  That is the pinnacle of a hypocrisy.

Privacy
The foundation for many things liberals support, such as abortion rights and gay rights, is privacy.  The idea that a woman should not be compelled to serve as an incubator for 9 months is based upon her right to be free from governmental intrusion into her body.  Similarly, the idea that consenting adults should be free from governmental intrusion into their bedrooms is based upon privacy as well.  Gun rights also fit in with other privacy rights, as law abiding citizens should be free to possess a gun in their own home or concealed about their person for self defense.  Furthermore, the current anti gun rights laws are used as a pretext to violate the 4th Amendment rights of citizens.

Self Determination
Along similar lines as privacy is the idea of self determination.  This basic idea also underlies abortion rights and gay rights, on the theory that the individual(s) should be able to determine their own course and destiny in life.  The idea of self determination also calls for gun rights, as the individual should be free to choose to have a gun for self defense.  Furthermore, an armed individual has greater control over their fate when facing a home invasion or other violent attack.

Conclusion
For the reasons discussed above, I am of the opinion that gun rights fit well with liberal ideology.  It is a shame that some liberals have decided to fight against gun rights, but hopefully this trend can be reversed.