Gabriel Golfetti's clear answer stresses the mathematical equivalence of the two extremum principles. Probably it could be helpful to discuss more in details the physical meaning of the two principles.
First of all, let's make explicit which variables the two functions (entropy $S$ and internal energy $U$) are functions of.
Maximum entropy principle applies to an isolated system characterized by a set of global extensive variables including the internal energy of the system, plus a set of additional vaiables ($X_{\alpha}$), characterizing internal constraints. The precise statement of the principle says that the equilibrium state at fixed global extensive variables, reached after relaxing the constraints on the variables $X_{\alpha}$'s is such that $S$ is maximum as a function of the $X_{\alpha}$ variables. For example, a fluid system characterized by total values of energy, volume and number of particles, maximum of entropy means that
$
S(U,V,N;X_{\alpha})
$
should be maximum with respect to $X_{\alpha}$.
A typical example is the condition for thermal equilibium between two subsystems of an isolated composite system. In that case, there is only one constraint variable, the energy of one of the two subsystems, $X=U_1$, if a fixed, impenetrable, insulating wall is modified to allow exchanges of energies (conservation of energy requires $U=U_1+U_2$). From the maximum entropy principle one derives the condition of equal temperatures of the two subsystems and the fact that energy goes from the subsystem at higher temperature to the colder.
A more complex example of constrained system could be the case of phase coexistence where the entropy of an inhomogeneous two-phase coexisting system is higher than the entropy of the constrained homogeneous systems at the same total energy, volume and number of particles.
Similar arguments can be used to discuss equilibrium states using the minimum energy principle. However, in such a case the function which is minimum with respect the constraint variables $X_{\alpha}$ is
$
U(S,V,N;X_{\alpha})
$. This implies that in the case of maxent principle, the total energy of the system is kept fixed and the system "chooses" among different values of the entropy the highest. In the case of minimum energy principle, is the global entropy which is kept fixed and the "choice" is among states at different energy.
Since both constant entropy and constant energy are not always the simplest or the most natural conditions, both extremum principles can be recast into corresponding extremum principles for all the possible Legendre transforms of the two fundamental equations. Therefore, from the minimum energy principles, on can derive minimum Helmholtz or Gibbs free energy principles.
Edit
After saving my answer I have realized that I didn't provide an explicit answer to the main question: which principle is more fundamental?
From a formal point of view, each extremum principle can be used as a starting point to derive all the remaining ones, therefore they should be considered as equivalent.
However, one could argue that some principles have a more fundamental base. My personal opinion is that maxent principles (for entropy and its Legendre transforms) have the advantage over minimum energy principles of more generality (entropy of information can be defined even for systems where energy plays no role in the probability distribution). But I would like to keep separate facts (mathematical equivalence) from opinions.