diff --git a/lib/spack/spack/solver/requirements.py b/lib/spack/spack/solver/requirements.py
index 412f4c22cddc240e0557baa26ed370f0913afdf3..975dbd4269e42154ac83b9f8c26feb2bd26a4449 100644
--- a/lib/spack/spack/solver/requirements.py
+++ b/lib/spack/spack/solver/requirements.py
@@ -10,6 +10,7 @@
 import spack.config
 import spack.error
 import spack.package_base
+import spack.repo
 import spack.spec
 from spack.config import get_mark_from_yaml_data
 
@@ -195,20 +196,30 @@ def reject_requirement_constraint(
         self, pkg_name: str, *, constraint: spack.spec.Spec, kind: RequirementKind
     ) -> bool:
         """Returns True if a requirement constraint should be rejected"""
-        if kind == RequirementKind.DEFAULT:
-            # Requirements under all: are applied only if they are satisfiable considering only
-            # package rules, so e.g. variants must exist etc. Otherwise, they are rejected.
-            try:
-                s = spack.spec.Spec(pkg_name)
-                s.constrain(constraint)
-                s.validate_or_raise()
-            except spack.error.SpackError as e:
-                tty.debug(
-                    f"[SETUP] Rejecting the default '{constraint}' requirement "
-                    f"on '{pkg_name}': {str(e)}",
-                    level=2,
-                )
-                return True
+        # If it's a specific package requirement, it's never rejected
+        if kind != RequirementKind.DEFAULT:
+            return False
+
+        # Reject default requirements for runtimes and compilers
+        if pkg_name in spack.repo.PATH.packages_with_tags("runtime"):
+            return True
+
+        if pkg_name in spack.repo.PATH.packages_with_tags("compiler"):
+            return True
+
+        # Requirements under all: are applied only if they are satisfiable considering only
+        # package rules, so e.g. variants must exist etc. Otherwise, they are rejected.
+        try:
+            s = spack.spec.Spec(pkg_name)
+            s.constrain(constraint)
+            s.validate_or_raise()
+        except spack.error.SpackError as e:
+            tty.debug(
+                f"[SETUP] Rejecting the default '{constraint}' requirement "
+                f"on '{pkg_name}': {str(e)}",
+                level=2,
+            )
+            return True
         return False