Is second authorship good for an undergraduate student planning for masters admit?
Any research experience is good for an undergraduate in the US, and likely elsewhere. Don't worry about author order too much yet. The doctoral student probably has a good claim on first authorship in any case.
But a publication on your CV is definitely a positive thing. Most people in the US start a MS or PhD with little or no real research experience.