Despite its success, Harry Potter movies had to come to an end because of the way JK Rowling crafted the plot. The story ends with the seventh book when Voldemort dies.
Since the movie strictly follows the year-to-year format in the books, an ending with the seventh movie was inevitable. The best they could do to increase the hype and cover all the details was to split the last movie into two parts.