Shakespeare introduced the expression, meaning “the ultimate or most important solution,” as dialogue for Macbeth.
Macbeth thinks about killing Duncan and wonders “that this blow might be the be-all and the end-all”, MacBeth I vii. IV.
Macbeth then says he would risk his status in the afterlife if it were true.
Today, Shakespeare’s second “the” is usually dropped but “the be-all and end-all” still means “the ultimate.”