Selecting a Yocto board
Boards are often ranked based on the popularity of the board and we would rate that quite high in selecting something that's workable, that's going to have answers online, for problems that you're going to run into. Be aware of stability and power issues, and look carefully at Raspberry Pi in comparison to Beaglebone Black in this regard. The power source is a noted challenge in the Raspberry Pi for its reliability. Read this comparison of the two boards.
Learn how to make a Yocto image work with a Raspberry Pi 4 Model B.
Learn how to make a Yocto image work with a Beaglebone Black
Highly constrained devices and Yocto
Microcontrollers might be too small to use Yocto. Because your next step would be to go to a microkernel operating system. Which is going to be quite different, and this is completely unsuitable for Yocto. There is a minimum specification that you will need to have to support a Yocto image. If you have less than 256 Mbytes of RAM, for example, you're probably starting to push it. If you are going to have dual root FS, you will need to have storage in the multi gigabyte range - 2 Gbytes at least: If your whole flash chip is 200 Mbytes then you are outside of the Yocto domain.
Yocto has less software, less security risks
The security advantage associated with a Yocto board is that there is no unnecessary software. This limits the range for potential attack vectors. In contrast, with Ubuntu, you would have more tools installed that could fail in various ways. Sometimes, even some of them can open to the network, which again can be vulnerable and you just have less of them in Yocto. To be clear Ubuntu is not less secure than Yocto, it's just that Yocto uses less software so has less vulnerabilities by virtue of this fact.
You can learn how to run CVE checks with Yocto Project.
Consider reading these other articles on Yocto: