I'll take a stab at guessing (mind you, this is blind guessing, happy to be corrected!): the USMC still issue bayonets because of both tradition, which is important to the military, and also because they are actually useful in close quarters battle, which still occurs on occasion, such as in urban warfare and house-to-house combat clearing, etc. The likelihood of having to use a bayonet/knife in modern CQB is probably significantly higher than the likelihood of medieval defenders recovering from an enemy army that has stormed their castle.
Having a knife might be useful in various situations even outside combat as far as I know.