How do weak students who want to do PhD's get into masters programmes in the first place?
As per the comments, you are interested in finding information from various places around the world, so I will provide a perspective from Germany (possibly limited, as there is a partial focus on computer science and closely related degrees, with which I am more experienced compared to other areas):


  If I'm not mistaken, master's degrees are, in some places, often seen as the first of a two-part process to getting advanced degrees, where the PhD is the second part.


As described elsewhere, Bachelor and Master often form a consecutive unit in Germany. The reason is historical, as the former Diplom degrees were cut into two parts approximately in the middle to insert the Bachelor degree after the first part of the studies. Studying for a doctoral degree optionally followed for some students after graduating with a Diplom, and likewise, it now optionally follows for some students after graduating with a Master's degree.

Therefore, at least in Germany, the Master's degree is the second of a two-part process of getting "basic, industry-level" degrees (the first part being the Bachelor's degree). Accordingly, in 2011 and 2012 (sources only in German, sorry), about 3/4 of all students who graduate from a German university with a Bachelor's degree continued to study for a Master's degree.

The doctoral degree is something separate that only a smaller fraction of students who graduated with a Master's degree start, as it usually focuses on research rather than educating a highly skilled employee for the industry.

Therefore, as an answer to your first question


  So finding a terminal master's programme doesn't sound that simple to me, although this may depend on the field.


While there are some disciplines (chemistry maybe?) where traditionally many Master graduates continue for a doctoral degree, entering the Master's degree as a terminal degree before completing one's higher education and starting to work full-time is rather the default in Germany.


  I would imagine that there's still a need for decent grades / recommendations / etc. to get into a master's programme in the first place.


Again related to the aforementioned historical development, there is a strong feeling that whoever has successfully completed their Bachelor's degree must be allowed to continue their studies if they so desire (as with the former Diplom degrees, no-one would be kicked out in the middle of their studies, either, unless they actually failed the requirements).

While I am not sure whether it is always possible at all universities to accommodate everyone who would like to continue with a Master's degree, I could get some limited insight into the "selection process" for which Bachelor graduates may continue with the Master studies on a few occasions. The general guideline was that unless there were any absolutely terrible obstacles (with previous marks that are bad, and just enough to fulfil the minimum requirements to get a Bachelor's degree explicitly not counting as such an obstacle), every applicant should be accepted.

Hence, getting into a Master's programme is not an overly hard problem; chances that one has to abort these studies due to failing exams during the Master studies are likely to be considerably higher.

This leaves two final summarizing statements:


  If so, how viable it is actually to get into a terminal master's programme


In Germany, probably rather viable.


  in order to boost future applications to PhD programmes?


In Germany, it's not a "boost" in the sense that improves chances prior to getting the degree; for most, if not all doctoral programmes, having a Master's degree is a minimum requirement.