I was 16yo when I had DD - and I had plenty of comments like this. Admittedly that was 13 years ago, but I did.
When I was in the delivery room just after the birth and I asked the MW if she could show me how to latch DD on, she was very dismissive - and told me "Oh, don't worry about that, I'll go and get you a bottle, 16yo's don't BF". My reply was "Well, this 16yo is going to, with OR without your help".
When I was in labour with my second dc, I was (just) 20yo, and I asked for pethidine - the MW refused, and told me that "The pain will teach you to keep your legs closed in future" - yes, I DID put in a formal complaint at that one!
When I was 17yo, and running through the town centre as I was running late, and a woman in her 40's stopped dead in front of my pram to rant at me that I shouldn't have a baby, I was stealing her tax money, and I was a benefits scrounger, and I ought to have my baby taken away from me, and I was probably spending all her taxes on drugs and neglecting my DD - I raised an eyebrow at her and said "Could you please move out of my way, I need to get my DD to Nursery quickly as I am running slightly late for work". Her face was a fucking PICTURE.
. (It was true BTW, I was on my way to work)
There are LOTS of people out there with shitty attitudes to young mothers. It doesn't mean that anyone should accept these comments - and certainly not from a HCP.
IF this OP is true, then PLEASE make an official complaint. In writing. And don't let it rest until you have an official apology AND the HCP is given some training on people skills at the very least.
IF the OP isn't true - then kindly stop posting bollocks.