"My friend works at a big org which has a programme for developing ethnic minority people and females. And it’s perfectly legal."
For it to be lawful it must, in effect, be two separate programmes. One programme for people of "ethnic minority" and a separate programme for women.
The wording of Section 158 is the same as that of Schedule 16 in that it talks about people "who share a protected characteristic":
158 Positive action: general
(1) This section applies if a person (P) reasonably thinks that—
(a) persons who share a protected characteristic suffer a disadvantage connected to the characteristic,
(b) persons who share a protected characteristic have needs that are different from the needs of persons who do not share it, or
(c) participation in an activity by persons who share a protected characteristic is disproportionately low.
(2) This Act does not prohibit P from taking any action which is a proportionate means of achieving the aim of—
(a) enabling or encouraging persons who share the protected characteristic to overcome or minimise that disadvantage,
(b) meeting those needs, or
(c) enabling or encouraging persons who share the protected characteristic to participate in that activity.
So, yes, you can separately do things to help support women and help support people of "ethnic minority". These are two separate things and are lawful based on the organisation believing that women suffer a disadvantage through being women. The organisation also separately believes that people of "ethnic minority" also suffer a separate disadvantage.
So you have two different groups that the organisation believes suffer a disadvantage.
The organisation takes actions to help women overcome their disadvantage. It also separately helps people of "ethnic minority" to overcome their disadvantage.
(Just a side note, if the organisation assumes that both those groups suffer from the same disadvantages and just need the same support then they haven't really thought about the separate issues).