He has low self esteem and it is what he thinks will make him seem cool.
He is immature and I would ditch him while the getting is good.
You like the attention, but it isn't cool attention. Move on, ignore him and, if he really likes you, you will know quickly enough. Keep giving him the cold shoulder until he learns to grow up or you will have to live with this bad habit for the rest of your life... he certainly won't change.