You can instruct the Yocto build system to specifically avoid certain licenses by using the INCOMPATIBLE_LICENSE configuration variable. The usual way to use it is to avoid GPLv3-type licenses by adding the following to your conf/local.conf file:
INCOMPATIBLE_LICENSE = "GPL-3.0 LGPL-3.0 AGPL-3.0"
This will build core-image-minimal and core-image-base images as long as no extra image features are included.