The maximum is attained at the family of all subsets of cardinality $\leq k/2$ if $k$ is even, and of all subsets whose intersection with $X\setminus\{x\}$ is of cardinatliy at most $(k-1)/2$ if $k$ is odd (here $x$ is some fixed element in $X$). This is proved by Kleitman in D. Kleitman, On a combinatorial conjecture of Erdös, J. Combin. Theory, Vol. 1, 209–214, at least for even values of $k$. P. Frankl attributes the full version to Kleitman (see Theorem 5.3 in P, Frankl, Extremal Set Systems, in R.L. Graham, M. Grötschel, L. Lovász (eds.), Handbook of Combinatorics, Vol. 2, Elsevier, 1995; pp. 1293--1330), but I am not sure whether Kleitman has actually claimed this. Anyway, the full version is proved in the cited Frankl's review.