This question is somewhat misleading because it makes no distinction between a Sacrament that does not necessarily require formal distribution by the Church (ex: Marriage, Baptism and Penance) and a Sacrament that does require formal distribution (Communion), as organized in ritual. 'Sacrament' here is being used not simply as a term thus for Church rituals, but rather for special unions and contracts in humanity that the Church has authority over in terms of distributive power as of a formal cause or proper knowledge regarding the nature of the union. As to which way the Church delegates this authority, such depends on the Sacrament itself and the understanding of the Church at the time (I would argue that marriage has been a sort of 'unofficial' Sacrament all throughout the early Church history, for obviously the Church exercised proper knowledge in the dealings of union).
In certain Sacraments, the grace achieved can in fact be achieved through a means that is not yet formally distributed by the clergy (the only exception being Communion). Even Baptism, though perhaps requiring a formal definition of its nature, can be distributed by those outside of the Church. This is because the nature of the Sacraments (again, besides Communion) do not formally rely on the Church for distribution. But this is not to say that the ones carrying out these Sacraments do not rely upon the infallibility of the Church to clarify what the purpose of these Sacraments are and the nature by which they are performed. Indeed, such a shared understanding is a necessity for the perfect practice of any such Sacrament. 'Marriage' itself always had to be an act of peace for those who considered themselves Christians, despite the Church's non-direct involvement in such a consensual agreement. And as an act of peace, the primary authority in understanding its nature was the Church, even if it was not the formal cause of the marriage contract. It is not as though there was a time in which the Church did not support a pure and God-centered marriage. For example, consider the verse Hebrews 13:4:
Let marriage be had in honor among all, and let the bed be undefiled: for fornicators and adulterers God will judge.
So to the question:
So, does that mean that before the Middle Ages, the Western Christian church did not really care about marriage?
The answer is rather plainly 'no'. The Church certainly has always been clear on the call of Christians to purity and the continuing moral theory that sexual impurity (such as homosexual acts, adultery, fornication, etc) are all detrimental precisely because such acts are contrary to natural law and as such destruct both the opportunity of utmost purity in celibacy and likewise purity in the intended marriage between a man and a woman.
As to why the Church formally delegated itself as the distributor of marriage in the Middle Ages, and formally stated Marriage as a Sacrament in the same way Communion and Baptism were considered Sacraments, it is largely because of St. Augustine's resurgent influence in the Middle Ages. But before further explanation, it is important here again to note that it is not as though the Church did not already intervene in the marriage process. As far back as Tertullian we find examples of witnesses asking for clergy members to marry them. In most cases in which there were disagreements regarding the nature of the marriage, the issue was resolved in ecclesiastical courts. In certain Orthodox traditions ranging back to the fourth century, it was customary for a priest to be a witness of a marriage. There are many other examples of a closeness of the Church to both the understanding of marriage and the practice of marriage. So the idea that the Middle Ages simply engendered some new and unexpected invasion of the Church into personal life (which is often the stance taken by overly zealous historians) is rather ridiculous.
As stated, the purpose for which the Church formally declared itself as the distributor of marriage is largely due to the increasing ideological influence from St. Augustine and other Church Fathers who looked favorably upon marriage as a higher form of contract than perhaps previously thought in and by the Church (St. Augustine himself using 'Sacrament' to describe marriage). It is also due to several heretical ideologies that formed in the Middle Ages regarding the nature of Sacraments and other unions, a few examples being Catharism and Waldensianism. Being influenced by St. Augustine, and hoping to counteract the heresies at the time, the Church ensured the protection of the union of marriage in its own faculty and language by making it a practice formally delegated to the clergy. Thus is it that the first 'official' decleration of marriage as a Sacrament was made in the 1184 Council of Verona, specifically in response to the Cathars.