It's a bit difficult to find the name, though using the word from the Japanese Wikipedia page, it seems to be this: 名札.
To summarize the Japanese Wikipedia page on gym clothes:
It seems like there are two reasons to have these name tags. The first reason is for identification for emergency response. If a student is injured while exercising or, in this case, has a problem while swimming, they can be quickly and easily identified. Also, it allows for identification both to help people keep their clothing straight and to be identifiable to the teachers/other students in the class.
This is corroborated as well in the German Wikipedia page on mizugi, or Japanese swim-wear, where it states that the name-tags help teachers identify their students because identification is otherwise difficult due to the swim-caps.
The reason for it being so popular with otaku subculture is likely just that swimsuits in general are popular, and this is just one aspect of it. Additionally, they are used in schools primarily, so they likely show an aspect of innocence that is also popular.