It是形式主语,being the oldest student是真正的主语.
这个句子如果还原你就更容易了解了:Being the eldest student was good.
同样可以将现在分词换成动词不定式.