The answer depends on knowing the definition of a biblical sacrament as held by the Catholic church, and what led Luther to define a biblical sacrament differently.
Luther had been brought up to believe, and passionately did so believe in the capacity of Holy Rome to confer spiritual benefits; to have various means of grace. Here is an official definition of what Catholicism declares sacraments to be:
"The sacraments... are the seven vital actions of the Church in its
liturgy which are efficacious for salvation. ...The theology of the
sacraments, which began in Scripture, was constantly developed in the
course of history." Encyclopedia of Theology, Ed. Karl Rahner,
p.1477 (emphasis mine)
In 1520, Luther had a series of tracts printed, one of which dealt with the sacraments, as detailed in this book from which I now quote:
"...when Erasmus read the tract [The Babylonian Captivity], he
ejaculated, 'The breach is irreparable.' The reason was that the
pretentions of the Roman Catholic Church rest so completely upon the
sacraments as the exclusive channels of grace and upon the
prerogatives of the clergy, by whom the sacraments are exclusively
administered. If sacramentalism is undercut, then sacerdotalism is
bound to fall. Luther practically reduced the number of the sacraments
from seven to two... The principle which dictated the reduction was
that a sacrament must have been directly instituted by Christ and must
be distinctively Christian." Here I Stand - Martin Luther by
Roland Bainton, p137, emphasis mine)
By comparing those two definitions / principles for sacraments, it can easily be seen why Luther reduced them from seven to two. Take marriage, for example. Not every Christian must be (or have been) married at some point in order to be saved. Jesus himself was never married (though some would claim he was - the Bible certainly does not even hint at that.) Nor had Christ instituted marriage; that had been instituted by God right from the Garden of Eden. Nor has marriage ever been a distinctly Christian state. It is a union open to all men and women who choose it.
I won't go into the other sacraments as my answer is not to justify the reduction by Luther, just to show why it came about. I just mention marriage by way of an example that illustrates Luther's principle upon which he based whether an institution should be a sacrament or not.
Two other details worth pointing out: (1) Luther strove to get back to what Christ instituted (whereas Catholicism had, over the centuries, enlarged on the initially biblical basis for a few). (2) Luther objected to the sacerdotal nature of the priesthood in exclusively administering all Catholic sacraments as a means of grace that held power and fear over the populace (which contradicts the term, 'grace'). For those two reasons, in conjunction with his definition of a sacrament needing to have been instituted by Christ, and as being distinctively Christian, Luther no longer considered the other five matters to be sacraments.