I've always taken the omission here to be or the phrase "worth of". As such, what one means when one says "two weeks' holiday" is actually "two weeks' worth of holiday" and likewise with, for example, notice and imprisonment. The worth in this case belongs to the time, just as the worth belongs to the money when one says "three quid's worth of [insert appropriate noun]".
One can actually then extend this to phrase like "We'll be finished in two weeks' time" which is equivalent to "We'll be finished two weeks from now" but here is like an abbreviation of "We'll be finished in two weeks' worth of time." In all cases, there is some redundancy -- one could simply say "We'll be finished in two weeks." -- but the uses are idiomatic.
Historically speaking, I doubt whether the phrase "worth of" actually ever appeared in using this form of possessive but it may be a helpful way to think about the phrase.
The best explanation to approximate this theory can be found in the Chicago Manual of Style section 7.24. Though not freely available online, you can find it mentioned here where it's claimed the form is inherited from the old genitive case:
Q. Which is correct? (a) He has 15 years’ experience designing
software, or (b) He has 15 years experience designing software. I’ve
seen it written both ways. I believe “years” needs an apostrophe. If
he has 15 years of experience, that would translate to “15 years’
experience.” Right? Please help.
A. You are absolutely right. Analogous to possessives, and formed like
them, are certain expressions based on the old genitive case. As your
question implies, the genitive here implies of. For some examples, see
paragraph 7.24 in CMOS 16.
This line features on the Wikipedia page for genitive case:
Modern English typically does not morphologically mark nouns for a genitive case in order to indicate a genitive construction; instead, it uses either the 's clitic or a preposition (usually of).
So in this argument the possessive/clitic actually stands in for the phrase "of".
This is backed up by one particular line on (unfortunately again) the English possessive Wikipedia page:
The paraphrase with of is often un-idiomatic or ambiguous in these
I should also add that Alex Chaffee's comment in reply to another answer on this question is useful in pointing to the Wikipedia page on the noun adjunct which cites Fowler's Modern English Usage.
For reference, the following sources mention a possessive apostrophe for this form of sentence as the correct use but do not provide any historical background or justification as to this usage:
I have just seen another answer providing some examples as possible objections to this usage. In each example, the phrase in question is preceded by an indefinite article. But this would not make sense if one thinks about the phrase I have suggested above.
For example "Take a two-week holiday" is correct; "Take a two-weeks' holiday is not." But that's because one would never say "Take a two-weeks' worth of holiday." Omit the indefinite article and suddenly, intuitively, all seems well: "Take two weeks' holiday."