Claim: Every open subset of $X$ is a basic open set if and only if $\text{Cl}(A)$, the ideal class group of $A$, is torsion. (In particular, this is true whenever $A$ is the ring of integers of a number field, for then $\text{Cl}(A)$ is finite.)
The question boils down to knowing whether, for any finite set of primes $\mathfrak{p}_1, \dots, \mathfrak{p}_n$, there is an $f\in A$ such that $\mathfrak{p}_1, \dots, \mathfrak{p}_n$ are exactly the primes of $A$ containing $f$.
Therefore, suppose $\text{Cl}(A)$ is torsion. Consider the ideal $I=\mathfrak{p}_1 \cdots \mathfrak{p}_n$. This has finite order in the class group, hence there is an integer $m$ such that $(g)=\mathfrak{p}_1^m \cdots \mathfrak{p}_n^m$ is principal. Then $f=g$ does the trick.
Conversely, if there is an element of infinite order in $\text{Cl}(A)$, then there must be such an element which is represented by a prime $\mathfrak p$ of $A$ (since the primes of $A$ generate the class group, by unique factorization of ideals). The complement of $\mathfrak p$ in $\text{Spec}(A)$ could not be a principal open set; otherwise, there would be $f$ such that $(f)=\mathfrak p^m$ for some $m$, contradicting that $\mathfrak p$ has infinite order in $\text{Cl}(A)$.
Note: Georges' pretty counterexample exhibits this idea: the group structure on an elliptic curve is none other than its (degree $0$) Picard group. Hence to find a Dedekind domain whose class group contains an element of infinite order, it sufficies to find an elliptic curve with a point of infinite order...