I would like to know the logic or philosophy behind beard in islam

We don’t always know the exact reason behind each rule. Allah knows best. However perhaps it is to differentiate the looks between men and women and keep the men looking masculine.