Take this GLSL sample code:
layout(set = 0, binding = 0) uniform BlockName {
mat4 someMtx;
} instanceName;
What is the purpose of "BlockName" in this context?
I know you can use the block name to match inputs/outputs of pipeline stages. But what is the purpose for uniform blocks in Vulkan?
The purpose is that GLSL requires it.
GLSL was made for OpenGL. It can be used with Vulkan, but the actual features of GLSL were made to serve the needs of OpenGL. Since Vulkan is a very different API, that means you're going to sometimes have vestigial functionality.
Like these.
In OpenGL, resources are identified, and can be queried, by name. Two resources are the same resource if they use the same name (they also have to match with other properties or an error results, but a name match is a requirement). As such, block names were made part of the grammar of GLSL interface blocks. You can't not have them on any interface blocks (UBOs being a subset of interface blocks).
Vulkan (and SPIR-V) doesn't care about names. For interface variables, the name remains useful because the GLSL code itself uses that name when it wants to access that variable. But block names were only used by the external API; they were never used by GLSL code itself.
So when you use a GLSL construct that uses an interface-only name to feed an API that doesn't care about interface names, you get block names: a name that needs to exist because GLSL requires it but doesn't actually do the thing GLSL expects it to.