When you 'take moments about a point', you will get a zero answer for a body in static equilibrium. If you take moments on ONE side of the section, you will get a non-zero answer which should be numerically the same as that algebraic sum on the OTHER side of the section - in this case w(l^2) /8. In using sign conventions, don't attribute a positive moment to a clockwise - anticlockwise- action. The important thing is whether the action is having a hogging effect, or a sagging effect. In your beam with udl, taking momets at the beam centre, the effect of the reaction is sagging, and the effect of the udl is hogging (from the point of view of someone standing underneath the beam). Sign conventions are a big problem that have no world-wide agreement, and plenty of misunderstandings are possible. With practice, the finer points will become clearer to you, and you should recognise that engineering theory is not always the same as engineering practice.
Reference
https://www.physicsforums.com/threads/maximum-moment-at-the-center.877845/