There are different ways of combining quotation and punctuation marks. In the American style, you almost always put periods and commas inside the quotation marks:
Dr Johnson kicked a large rock and said, as his foot rebounded, "I refute it thus."[1]
It is only an accident of evolution, as it were, that the senses we are born with are not adapted to feel such things "directly."[2]
In the British style, however, you put periods and commas outside the quotation marks, unless they are part of a complete sentence that is fully contained between the quotation marks:
Dr Johnson kicked a large rock and said, as his foot rebounded, "I refute it thus."[3]
It is only an accident of evolution, as it were, that the senses we are born with are not adapted to feel such things "directly".[4]
When faced with this contrast, the proper reaction is to recoil in horror at the first approach, and to look approvingly on the second. In the sentence beginning with It is only ..., the quotation is a part of the sentence, and the sentence contains the quoted word.
It is only an accident of evolution ... "directly".
[--------------------sentence---------------------]
[--quote-]
Since a period marks the end of a sentence, it should not be placed before marking the end of the quotation. You can compare this with nested or hierarchical structures, or with stacks, or even with last in, first out methods of computing, inventory accounting or redundancy management. Under any comparison, the British style will seem preferable to the American. You resolve the nested item first, before resolving the parent. I do not know but suspect that this is why the British style is also called logical quotation.
In the sentence beginning with Dr Johnson ..., we do place the period within the quotation marks, because what is being quoted is a full sentence. We are placing the period to mark the end of the inner, quoted sentence.[5]
Dr Johnson kicked a large rock ... "I refute it thus."
[----------------------sentence----------------------]
[------quote------]
[----sentence---]
There is no reason that there should be two different approaches to punctuation in the English language. The British approach makes more sense, so use that one.
Minor curiosity: originally, back in old printing days, quotations marks went neither before nor after punctuation marks, but above these, after all, it's a half-height symbol with empty space below it, and another half-height symbol with empty space above it, so both merged well into a single combined glyph, saving space.
When movable types entered the picture almost no types set had unified quotation+punctuation types, so both were physically distinct symbols that needed a sequence when placed on the printing board. Over time the US mostly settled with punctuation-then-quotation, while most other countries went mostly with quotation-then-punctuation -- which on further analysis (and then with programming languages) proved more sensible.
Nowadays with modern Unicode ligatures we could easily go back to quotation-over-punctuation for display purposes, while allowing the writing to be either way, but I suppose after 200 years of printing these glyphs separately no one has much interest in that.
I personally think quotation-over-punctuation would solve this nicely. Here's an example from someone who managed to have his TeX documents do exactly that: