Also, the militia act isn't the law, the Constitution is.
The Constitution isn't scripture, written by gods and prophets for whom citizens should try to guess their superior, divine wisdom and intent. It's a political document, written by people as human as we are - well-meaning and flawed; earnest, careless, and horribly corrupt; etc. - just like current politicians. The wording is a compromise among those people, who certainly had many intents. (What is the "intent" of a law passed Congress? To find semi-ambiguous wording that can get a majority of votes.)
Most fundamentally, the U.S. is a democracy (and if you care for the founders' intent, that's clearly a big one), not a secular theological state ruled by the will of dead philosopher-kings. Current U.S. citizens decide the law and what the words mean, majority rules.
Powers that are granted by the Constitution to the government (for example, Congress ability to pass law).
Powers that are implied to be given to the government (for example, the President's cabinet).
Powers that are left out and to be decided by the states and the people at a later time (for example, any new laws that are not in conflict with the Constitution).
And finally, powers that are DENIED to the government (these are powers the government must NEVER have).
Now, let's read the 2nd Amendment: ...the right of the people to keep and bear arms shall not be infringed.
>shall not be infringed
In other words, the Constitution specifically DENIED the government the power to regulate arms. The government does not have that power. The government was NOT given that power.
One thing to consider is that nothing is a literal absolute in the law; it's not an algorithm. For example, nobody denies the government's right to regulate arms as far as background checks, denying them to criminals, and until very recent history, much more stringent bans on possession - until recently, centuries of American jurists interpreted the law differently, and many still do; were/are they all illiterate? So easily dismissed by online amateurs? Also, government can outlaw advanced arms such as anti-tank and anti-aircraft weapons, and fully automatic weapons.
The government also can't regulate speech according to the text - except that it can: Dangerous speech (shouting fire in a crowded, dark movie theater where there is none, or inciting someone to murder), false commercial speech (lying in your ads), slander, etc. are all illegal.
And you also miss the phrase "In order to" as in for example... it was only one of the reasons why the right to bear arms should not be infringed, not the only one. The bill of rights was at the time argued as superfluous as some felt that most people understood that those were inalienable rights and didn't need to be spelled out. Others felt otherwise (with foresight) and wanted stronger provisions, many of which were in the original Articles of Confederation the country was founded under before the Constitution.
A militia being "well regulated" (in modern English) by the government that it might need to fight is the opposite of that.