Can my advisor ask me to drop a project? I am a 5th year neurobiology phd student at a US institution. The data I have collected for my main project is not very exciting. Although it looks like I will be able to cobble together a paper, it won't be as shiny as it first appeared. A side project (tangentially related) has actually yielded much more interesting data, though I have been told by my PI to focus on my main project and to not further pursue the other project. I have pushed back without success. Since I am using my PI's resources, I feel obliged to discontinue that work, though I am curious if I do have any rights in that regard.

Some background information: My PI is one of the leading researchers in the field. There are rumors that my PI is planning to retire soon, and I have mentioned that I am trying to graduate this year. I have a good relationship with my PI and we check in on a regular basis. The average time to graduate in my program is between 5 and 7 years.
There are three different hats your advisor might be wearing, and the question how strong you should drop that project can be depends on which one it is.

As your advisor: Your PhD advisor's responsibility is to, well, advise you on your PhD. So it is definitely appropriate for them to suggest that you focus on one project and drop another. However, the person ultimately responsible for your PhD research is you. If you disagree with the advice, you are free to pursue the research you want to focus on. [Obviously, you should not readily dismiss the advice of your advisor, and if you or your advisor feel they cannot advise you, the advising relationship might have to end.]

As your manager: In many settings, PhD students are also some sort of employee, and as such have a manager supervising their work. This person will typically be the same as the advisor. However, acting as manager, it is probably within their authority to direct what you work on. As such work contracts are almost universally for fewer hours than a PhD student is actually expected to work, you can use that extra time to pursue your side projects. Be wary of the risk for conflict though if you and your manager have different impressions on how much time you spent on what.

As your lab head: Some research requires resources besides the time of the researcher. If you are given access to such exclusive resources in order to work on some particular research, then using them for a side project would be unethical. In many cases, the resources might be paid for by a grant to do particular research, so it might not even be allowed for your advisor to give you permission to use them for your side project. If this applies to you, you might want to look for small grant schemes you can apply for to get the required resources for the side project.