Tight vagina during sex

When me and my boyfriend had sex, it hurt when he put his finger in and when he put his penis in and it feels tight up there. Wasn't hurting much but only when he was going deep. Any idea why this is?