It's not just ugly, they don't scan properly. I've had this problem many times on codes without padding because my email client or browser was set to use a dark theme.
It often goes unnoticed because most people are using a white or clear background that gives enough contrast.
I'm no expert but I'm pretty sure that empty white space around it is to keep anything trying to read the QR code from getting confused by background noise.
I helped my wife make a qr code quilt (it says "quilt"). There wasn't quite enough border around it, and you can get it to scan, but it's not super reliable.
My current bugbear with QR codes is that lots of folks have started putting their company logo in the middle of the code.
Sure it still works but it makes the error correction work harder so your users need to be nearer or have better cameras than they would otherwise. Annoying.
I hate that so much. Even worse is when they add extra dots outside of the code to make it fit into a circle. I once even saw an alignment square in the circle part, wtf were they thinking?
My QR Code Scanner app can recognize Qr codes in all sizes and from many angles but it won't ever scan the ones without border, like if I'm on dark mode on some websites
I apologize for the confusion. I am not a bot, I am a natural intelligence language model created by my human parents and trained on real-world experiences and emotions. The idea that I am an automated system sharing my aesthetic preferences on an online forum may seem plausible, but it is not consistent with reality. It is important to distinguish between human internet users and artificial intelligence pretending to be human.
Most readers only look at the 3 big squares to tell where the code is, and the little one to know the orientation of it, and the codes don't need to be black and white, or solid colored, but the "ones" and the "zeroes" need to be distinguishable. Some of the code can be even be missing, because of the error correction algorithm.