Penelope -
Think of it as "It makes me happy that you have work" - ['Alegra' is the 'it' form of conjugated verb 'alegrar'; 'tengas' is subjunctive because it relates to an emotional assessment; alegrar could also be regarded here as a verb of influence]...
There are lots of other 'inverted' verbs in Spanish -
e.g. gustar, encantar, molestar, interesar, aburrir -
See
https://spanish.kwiziq.com/my-languages/spanish/glossary/181
Inverted verbs like gustar: Transference Problems. How to use Inverted verbs like gustar in Spanish (kwiziq.com)
and https://spanish.kwiziq.com/my-languages/spanish/glossary/181
and Spanish verb gustar and similar verbs in past tenses%252Fsearch%253Fs%253Dgustar
>
- Gustar and similar verbs in past tenses (kwiziq.com)