The issue is quite simple. You need a Vgs of about 2.5V to turn the mosfet on. If you want point B to be 10V, then the gate needs to get about 12.5V. A bootstrap circuit of some sort is needed. Otherwise, use a p-channel.
It's not gonna work that way. You need to replace the
N-channel fet with a P-channel and drive it with a NPN
BJT, a N-channel mosfet or with a CMOS level translator
like the CD 40109B or even with a TTL open collector high
voltage output.
Alternatively to achieve an output of 0 to 10V with this kind of transistor you must reconfigure so that the resistor is on the top of the transistor, from drain to +10v and connect the transistor source to gnd. Now, taking output from the drain you will see 0 to 10V but it will be inverted compared to the input.