Farmers sometimes castrate some bulls so that they aren't aggressive and that they don't reproduce.
Are there any Hindu scriptures that discuss this practice, like if it's sinful or not?
Yes , Hinduism scriptures are talking about the bull. And not only against castrating of bulls but totally against harming bulls in any way . The puranas are saying that one should look upon the bull as his own life and the bulls body as his own. i.e. one should take care of bull as himself and treat his body as he concern about his own body.
Padma Purana -Part 2 - Section 1 - Shrishti-Kanda -chapter 48 is about importance of bull alone with cow. This chapter deals with everything related to bulls and centered towards a farmer and how he should treat his bull , how he should employ his bull , for how much time and how much efforts etc.
According to the chapter the bull should be treated with utmost care , how should he construct a hut for his living and comfort , how much hours of work one should took from bull and proper respect should be given to him . Even in hinduism using bull to pull a cart is sin cause the bull suffers but if proper care and respect is given to bull , the owner will not suffer its consequences .
आत्मनः शयनीयस्य सदृशं कारयेद्बुधः|
समं निर्वापयेद्यत्नाच्छीतवातरजस्तथा ||113||
प्राणस्य सदृशं पश्येद्गां च सामान्यविग्रहम् |
अस्य देहे सुखंदुःखं तथा तस्यैव कल्पते ||114||
A wise man should get fashioned a cowpen like his own couch. He should make it completely free from dust and cold . One should look upon the bull as his own life , and the bull's own body similar to his own .Pleasure and pain are possible the bulls body as in his own body.
Conclusion - So its clear from above verse that one should treat the pain of the bull like the pain caused to him. And that mean one should not harm the bull in anyway. Castrating a bull cause him pain and is thus not allowed in Hinduism (even he is weak or do no reproduce) its a sin according to hinduism .