Mate this makes zero sense. None. Nada.
Write a law which allows the government to throw off its' own tyrannical yoke? What? Why would a government create a rule which would make itself untenable? The 13 Colonies had just proven how successful they could be in Revolutionary War - this doesn't make sense to me.
"Well regulated militia" means armed, land owning citizens who would give and follow orders and carry them out competently in the field.
I still say that the 2A was written by the newly formed USA Government to create a provision for citizens to join the ranks of the army against the kind of Left Wing extremism which was running rampant through and nearly ruined France.
I further believe that rather than acting in the interests of citizens and fostering a sense of loyalty and cooperation between them and the Government, the NRA has instilled a culture of fear and suspicion through the USA, happily raking in the profits from scared citizens who must register their guns. Look at how severe the penalties are for owning unregistered guns! It's money making and Republican Senators love it:
https://www.newsweek.com/republican-senators-nra-funding-texas-school-shooting-uvalde-1710332