It seems that monks were major producers of wine during the middle ages, and some still are today.
Was wine from a particular monastery sold and consumed locally or was it exported to distant lands?
Did wine sales serve as a small addition to the meager monastic income, just helping the monks get by, or was this a huge for-profit industry? If so, who profited? The monks and monasteries themselves, or was it centralized into the hands of leading archbishops and popes? (e.g. would the Borgia family have profited from church-produced wine?)
The answer to your general question is yes, Monks did sell their wine. Many monasteries produced wine at a capacity that went far beyond what they could consume internally. For example the monastery that owned the Clos Vougeot vineyard in burgundy could house over 2000 barrels on wine. That is the equivalent of 600,000 bottles. Even considering that major monasteries had an obligation to host traveling dignitaries and their companions, this is alot of extra wine.
Wine was sold by monasteries in the same manner that any landholding entity did during the middle ages. Wine was actually a primary trade good during the middle ages and some scholars argue that the wine trade was the catalyst that helped drive society more towards a capitalist system (see Burgundy to Champagne: The Wine Trade in Early Modern France by Thomas Brennan). The manner in which this business was transacted is somewhat hard to summarize because it varied across and time and location, but generally local merchants would buy finished wine from local growers (including the church and local aristocrats) and then sell the wine to remote merchants to transport the wine to their markets.
When a monastery made money from the wine trade the funds would go into the treasury of monastery. At that point the abbot of the monastery was in charge of deciding how the money was to be spent but monasteries in most monastic systems were related to each other in a hierarchical system and each monastic house was required to send money to the central house of the system. The most important winemaking religious order during the middle ages were the cistercians and each cistercian house was required to send money to the central authority located at the Citeaux monastry. The money was used by each house and then central authorities to fund both regular operations and well as projects such as the building of abbeys. It is certainly possible to find contemporaneous accounts accusing monks of living lives a bit too comfortable and luxurious. A significant amount of money was paid in tax to Cardinals and the pope as well.
If you are very interested in the subject of the wine trade in the middle ages I would recommend Wine Trade in Medieval Europe 1000-1500 by Susan Rose.
If you are interested in learning about the finances of medieval monasteries (and who isn't?) I would recommend The Finances of the Cisterian Order in the 14th Century by Peter King.